[git commit] shell/read: do not allow empty variable name
Denys Vlasenko
vda.linux at googlemail.com
Sat Jun 17 17:52:20 UTC 2023
commit: https://git.busybox.net/busybox/commit/?id=2ca9c45953cdb5a1bd6144c6eed5a8f14c551122
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
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;
More information about the busybox-cvs
mailing list