← Commit list

4fdb67cc6

Denys Vlasenko
Denys Vlasenko
2011-02-15
FAILED Duration: 224s

Subject

echo: fix SEGV when run with no args

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 →

coreutils/echo.c+1 -1
@@ -97,7 +97,7 @@ int echo_main(int argc UNUSED_PARAM, char **argv)
buflen += strlen(arg) + 1;
pp++;
}
- out = buffer = xmalloc(buflen);
+ out = buffer = xmalloc(buflen + 1); /* +1 is needed for "no args" case */
while ((arg = *argv) != NULL) {
int c;