summaryrefslogtreecommitdiff
path: root/tests/test_select_static.c
diff options
context:
space:
mode:
authorjvoisin2023-11-16 16:42:41 +0100
committerjvoisin2023-11-16 16:42:41 +0100
commit52ec4848225a0e9f577272015ced52c45923d4ba (patch)
tree2d0f2395dfd51d7b2810b7be3e549176b8a6c736 /tests/test_select_static.c
parentcfdcaf72ca60db28ad8a7240a5a09e99151cab24 (diff)
Add hardening for select()
This is unlikely to be used, since fd_set is usually manipulated by macros, but it doesn't hurt to add a simple comparison.
Diffstat (limited to 'tests/test_select_static.c')
-rw-r--r--tests/test_select_static.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_select_static.c b/tests/test_select_static.c
new file mode 100644
index 0000000..c2abf7f
--- /dev/null
+++ b/tests/test_select_static.c
@@ -0,0 +1,16 @@
1#include "common.h"
2
3#include <sys/select.h>
4
5int main(int argc, char** argv) {
6#if !defined(__clang__)
7 fd_set rfds;
8
9 CHK_FAIL_START
10 select(1337, &rfds, NULL, NULL, NULL);
11 CHK_FAIL_END
12
13 puts((const char*)&rfds);
14#endif
15 return ret;
16}