← Commit list

9cd4c76b5

Denis Vlasenko
Denis Vlasenko
2008-06-18
FAILED Duration: 17s

Subject

ash: fix "shift BIGNUM" and "read with no variable name" bugs. omg. hush testsuite helps to find bugs in ash! what next?

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/ash.c+4 -2
@@ -9549,7 +9549,7 @@ shiftcmd(int argc ATTRIBUTE_UNUSED, char **argv)
if (argv[1])
n = number(argv[1]);
if (n > shellparam.nparam)
- ash_msg_and_raise_error("can't shift that many");
+ n = shellparam.nparam;
INT_OFF;
shellparam.nparam -= n;
for (ap1 = shellparam.p; --n >= 0; ap1++) {
@@ -11994,6 +11994,8 @@ typedef enum __rlimit_resource rlim_t;
static int
readcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
+ static const char *const arg_REPLY[] = { "REPLY", NULL };
+
char **ap;
int backslash;
char c;
@@ -12086,7 +12088,7 @@ readcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
}
ap = argptr;
if (*ap == NULL)
- ash_msg_and_raise_error("arg count");
+ ap = (char**)arg_REPLY;
ifs = bltinlookup("IFS");
if (ifs == NULL)
ifs = defifs;