From 7dbcb76e77361970f7223c1bca4fdc9bb0436a08 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Wed, 29 Oct 2014 23:21:38 +0100 Subject: [PATCH] sandbox: init cli for -c sandbox crashes if a variable is set in the -c command, because hush's top_vars is not allocated. Call cli_init() from sandbox to ensure this is done before we execute the -c command. $ ./u-boot -c 'a=1' ... Segmentation fault (core dumped) Signed-off-by: Rabin Vincent Acked-by: Simon Glass #include +#include #include #include #include @@ -76,6 +77,8 @@ int sandbox_main_loop_init(void) /* Execute command if required */ if (state->cmd) { + cli_init(); + run_command_list(state->cmd, -1, 0); if (!state->interactive) os_exit(state->exit_type); -- 2.39.5