summaryrefslogtreecommitdiff
path: root/gnulib
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-11-15 22:23:01 +0100
committerJim Meyering <meyering@redhat.com>2009-11-16 09:30:50 +0100
commit161e5120d4c586950ad6a110baa039ab11af1038 (patch)
tree250f02d4ad225a8d1dcc8cedd3df0f9ec7415700 /gnulib
parent3b997a9bcb05198c880e5d1605a3c96c1d7f9c5d (diff)
downloadcoreutils-161e5120d4c586950ad6a110baa039ab11af1038.tar.xz
true, false: perform initialization only when argc == 2
* src/true.c (main): There is no reason to examine argv[0], call atexit, etc., in the usual case in which we're about to exit. This has the side effect of making it so that these programs no longer segfault when subjected to execve abuse. Before this change, these commands would make "true" segfault: printf '%s\n' '#include <unistd.h>' 'int main(int c, char**v)' \ '{ execve (v[1], 0, 0); }' > k.c && gcc k.c && ./a.out $PWD/true Now it succeeds. Reported by Tetsuo Handa and Bart Van Assche via Ondřej Vašík in http://bugzilla.redhat.com/537684.
Diffstat (limited to 'gnulib')
0 files changed, 0 insertions, 0 deletions