mirror of
https://git.busybox.net/busybox.git
synced 2024-11-23 13:43:28 +08:00
echo: fix SEGV when run with no args
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
28556b95fe
commit
4fdb67cc65
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user