summaryrefslogtreecommitdiff
path: root/tests/test_fread_int_overflow.c
diff options
context:
space:
mode:
authorjvoisin2023-07-09 18:03:34 +0200
committerjvoisin2023-07-09 18:03:34 +0200
commitf9f83da31803062d1fb665ad612ccede5e445757 (patch)
tree13216a6e43b1d17e17ef8b26c80fcc30c6abf7df /tests/test_fread_int_overflow.c
parent33acec595b47ec97ae57a98ec396a26f6d8e309e (diff)
Add tests for stdio.h
Diffstat (limited to 'tests/test_fread_int_overflow.c')
-rw-r--r--tests/test_fread_int_overflow.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_fread_int_overflow.c b/tests/test_fread_int_overflow.c
new file mode 100644
index 0000000..2f0c43f
--- /dev/null
+++ b/tests/test_fread_int_overflow.c
@@ -0,0 +1,14 @@
1#include "common.h"
2
3#include <stdio.h>
4
5int main(int argc, char** argv) {
6 char buffer[12] = {0};
7
8 CHK_FAIL_START
9 fread(buffer, (size_t)-1, (size_t)-1, NULL);
10 CHK_FAIL_END
11
12 puts(buffer);
13 return ret;
14}