← Commit list

2ca9c4595

Denys Vlasenko
Denys Vlasenko
2023-06-17
SUCCESS Duration: 154s

Subject

shell/read: do not allow empty variable name

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/shell_common.c+1 -1
@@ -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;