diff options
author | Denys Vlasenko | 2023-06-17 19:52:20 +0200 |
---|---|---|
committer | Denys Vlasenko | 2023-06-17 19:52:20 +0200 |
commit | 2ca9c45953cdb5a1bd6144c6eed5a8f14c551122 (patch) | |
tree | 30263687838598715a49941ee00cc21ce168eb8f /shell | |
parent | 822590f5e29c613dd1401ba4309c0684426fc4f4 (diff) | |
download | busybox-2ca9c45953cdb5a1bd6144c6eed5a8f14c551122.zip busybox-2ca9c45953cdb5a1bd6144c6eed5a8f14c551122.tar.gz |
shell/read: do not allow empty variable name
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-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 13163ac..1eca101 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; |