From 52ec4848225a0e9f577272015ced52c45923d4ba Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 16 Nov 2023 16:42:41 +0100 Subject: 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. --- tests/test_select_static.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_select_static.c (limited to 'tests/test_select_static.c') 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 @@ +#include "common.h" + +#include + +int main(int argc, char** argv) { +#if !defined(__clang__) + fd_set rfds; + + CHK_FAIL_START + select(1337, &rfds, NULL, NULL, NULL); + CHK_FAIL_END + + puts((const char*)&rfds); +#endif + return ret; +} -- cgit v1.3