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:
0ed5f7a
)
shuf: fix a segfault on 'shuf -e'
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Fri, 7 Mar 2014 10:46:03 +0000
(11:46 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 7 Mar 2014 10:46:03 +0000
(11:46 +0100)
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/shuf.c
patch
|
blob
|
history
diff --git
a/coreutils/shuf.c
b/coreutils/shuf.c
index f213d675923bb7a603340a5df6e14eb8de2bb6b8..648a4abbb39337b4377cca6c190919176a73ab11 100644
(file)
--- a/
coreutils/shuf.c
+++ b/
coreutils/shuf.c
@@
-126,7
+126,8
@@
int shuf_main(int argc, char **argv)
fclose_if_not_stdin(fp);
}
- shuffle_lines(lines, numlines);
+ if (numlines != 0)
+ shuffle_lines(lines, numlines);
if (opts & OPT_o)
xmove_fd(xopen(opt_o_str, O_WRONLY|O_CREAT|O_TRUNC), STDOUT_FILENO);