mirror of
https://git.busybox.net/busybox
synced 2026-01-31 16:43:21 +00: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
1 changed files with 1 additions and 1 deletions
|
|
@ -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 a new issue