diff options
Diffstat (limited to 'tests/test_fread_overwrite_dynamic.c')
| -rw-r--r-- | tests/test_fread_overwrite_dynamic.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_fread_overwrite_dynamic.c b/tests/test_fread_overwrite_dynamic.c new file mode 100644 index 0000000..b108dc5 --- /dev/null +++ b/tests/test_fread_overwrite_dynamic.c | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <assert.h> | ||
| 4 | #include <stdio.h> | ||
| 5 | |||
| 6 | int main(int argc, char** argv) { | ||
| 7 | char buffer[12] = {0}; | ||
| 8 | |||
| 9 | assert((sizeof(buffer) - 2) * argc > sizeof(*buffer)); | ||
| 10 | |||
| 11 | CHK_FAIL_START | ||
| 12 | fread(buffer, sizeof(buffer) - 2, argc, NULL); | ||
| 13 | CHK_FAIL_END | ||
| 14 | |||
| 15 | puts(buffer); | ||
| 16 | return ret; | ||
| 17 | } | ||
