From 2ca9c45953cdb5a1bd6144c6eed5a8f14c551122 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 17 Jun 2023 19:52:20 +0200 Subject: shell/read: do not allow empty variable name Signed-off-by: Denys Vlasenko --- shell/shell_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/shell_common.c b/shell/shell_common.c index 13163acdf..1eca101b9 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c @@ -57,7 +57,7 @@ shell_builtin_read(struct builtin_read_params *params) argv = params->argv; pp = argv; while (*pp) { - if (endofname(*pp)[0] != '\0') { + if (!*pp[0] || endofname(*pp)[0] != '\0') { /* Mimic bash message */ bb_error_msg("read: '%s': bad variable name", *pp); return (const char *)(uintptr_t)1; -- cgit v1.2.3-55-g6feb