test_fread_overwrite_static.c (289B)
1 #include <assert.h> 2 3 #include "common.h" 4 5 #include <stdio.h> 6 7 int main(int argc, char** argv) { 8 char buffer[12] = {0}; 9 10 assert((sizeof(buffer) - 2) * 10 > sizeof(buffer)); 11 12 CHK_FAIL_START 13 fread(buffer, sizeof(buffer) - 2, 10, NULL); 14 CHK_FAIL_END 15 16 puts(buffer); 17 return ret; 18 }