diff options
| author | jvoisin | 2023-07-09 18:03:34 +0200 |
|---|---|---|
| committer | jvoisin | 2023-07-09 18:03:34 +0200 |
| commit | f9f83da31803062d1fb665ad612ccede5e445757 (patch) | |
| tree | 13216a6e43b1d17e17ef8b26c80fcc30c6abf7df /tests/test_fwrite_int_overflow.c | |
| parent | 33acec595b47ec97ae57a98ec396a26f6d8e309e (diff) | |
Add tests for stdio.h
Diffstat (limited to 'tests/test_fwrite_int_overflow.c')
| -rw-r--r-- | tests/test_fwrite_int_overflow.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_fwrite_int_overflow.c b/tests/test_fwrite_int_overflow.c new file mode 100644 index 0000000..1655498 --- /dev/null +++ b/tests/test_fwrite_int_overflow.c | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <stdio.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | char buffer[12] = {0}; | ||
| 7 | |||
| 8 | CHK_FAIL_START | ||
| 9 | fwrite(buffer, (size_t)-1, (size_t)-1, NULL); | ||
| 10 | CHK_FAIL_END | ||
| 11 | |||
| 12 | puts(buffer); | ||
| 13 | return ret; | ||
| 14 | } | ||
