Dr. David Alan Gilbert 025f1082b6 Fix select decoding with bogus (huge or negative) nfds.
We used to allocate and fetch bit arrays using a sanitized
length, but then iterate over them with "j < arg[0]" condition,
where arg[0] is not sanitized. This segfaults if arg[0] is huge
or negative. This change fixes this.

Add test/select.c to capture the case.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2013-11-05 11:54:51 +01:00
..
2013-05-02 22:41:50 +00:00
2013-05-02 22:41:50 +00:00
2013-02-19 11:54:36 +01:00
2013-05-02 22:43:47 +00:00
2013-05-02 22:41:50 +00:00
2013-05-01 14:54:05 +00:00
2013-05-02 22:43:47 +00:00
2013-05-02 22:41:50 +00:00
2013-02-17 13:17:49 +01:00
2013-02-18 03:13:07 +01:00

To run a test:
* Run make
* Run resulting executable(s) under strace
* Check strace output and/or program's output and exitcode

To add a new test:
* Add its .c source to this dir
* Add it to "all" and "clean" targets in Makefile
* Add it to .gitignore file

Please spend some time making your testcase understandable.
For example, it may print an explanation how it should be used
(which strace options to use, and what to look for in strace output).

If possible, make it so that your testcase detects error/bug
it is intended to test for, and prints error message and exits with 1
if the bug is detected, instead of relying on user to peruse strace output.