← Commit list

58adbb550

Bartosz Golaszewski
Bartosz Golaszewski
2014-03-07
SUCCESS Duration: 148s

Subject

shuf: fix a segfault on 'shuf -e'

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/shuf.c+2 -1
@@ -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);