Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-06-17 20:52:20 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-06-17 20:52:20 +0300
commit2ca9c45953cdb5a1bd6144c6eed5a8f14c551122 (patch)
tree30263687838598715a49941ee00cc21ce168eb8f
parent822590f5e29c613dd1401ba4309c0684426fc4f4 (diff)
shell/read: do not allow empty variable name
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/shell_common.c2
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)
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;