projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28556b9
)
echo: fix SEGV when run with no args
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 15 Feb 2011 17:35:54 +0000
(18:35 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 15 Feb 2011 17:35:54 +0000
(18:35 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/echo.c
patch
|
blob
|
history
diff --git
a/coreutils/echo.c
b/coreutils/echo.c
index 42c3f9ed864d04e3788c58004f97c4d7d084fe27..72e18c161209419894528f91e30a53885a16edb8 100644
(file)
--- a/
coreutils/echo.c
+++ b/
coreutils/echo.c
@@
-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;