diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-06-17 19:52:20 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-06-17 19:52:20 +0200 |
commit | 2ca9c45953cdb5a1bd6144c6eed5a8f14c551122 (patch) | |
tree | 30263687838598715a49941ee00cc21ce168eb8f /shell/shell_common.c | |
parent | 822590f5e29c613dd1401ba4309c0684426fc4f4 (diff) | |
download | busybox-w32-2ca9c45953cdb5a1bd6144c6eed5a8f14c551122.tar.gz busybox-w32-2ca9c45953cdb5a1bd6144c6eed5a8f14c551122.tar.bz2 busybox-w32-2ca9c45953cdb5a1bd6144c6eed5a8f14c551122.zip |
shell/read: do not allow empty variable name
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/shell_common.c')
-rw-r--r-- | shell/shell_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
57 | argv = params->argv; | 57 | argv = params->argv; |
58 | pp = argv; | 58 | pp = argv; |
59 | while (*pp) { | 59 | while (*pp) { |
60 | if (endofname(*pp)[0] != '\0') { | 60 | if (!*pp[0] || endofname(*pp)[0] != '\0') { |
61 | /* Mimic bash message */ | 61 | /* Mimic bash message */ |
62 | bb_error_msg("read: '%s': bad variable name", *pp); | 62 | bb_error_msg("read: '%s': bad variable name", *pp); |
63 | return (const char *)(uintptr_t)1; | 63 | return (const char *)(uintptr_t)1; |