← Commit list

853cfe927

Akos Somfai
Akos Somfai
2023-04-12
SUCCESS Duration: 158s

Subject

lineedit: fix crash when icanon set with -echo

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/lineedit.c+2 -2
@@ -254,7 +254,7 @@ static NOINLINE const char *get_homedir_or_NULL(void)
const char *home;
# if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH
- home = state->sh_get_var ? state->sh_get_var("HOME") : getenv("HOME");
+ home = state && state->sh_get_var ? state->sh_get_var("HOME") : getenv("HOME");
# else
home = getenv("HOME");
# endif
@@ -2038,7 +2038,7 @@ static void parse_and_put_prompt(const char *prmt_ptr)
if (!cwd_buf) {
const char *home;
# if EDITING_HAS_sh_get_var
- cwd_buf = state->sh_get_var
+ cwd_buf = state && state->sh_get_var
? xstrdup(state->sh_get_var("PWD"))
: xrealloc_getcwd_or_warn(NULL);
# else