4 ms·
I think you underestimate current C compilers. GCC with -D_FORTIFY_SOURCE=2 successfully detect a buffer overflow at runtime when doing: strcpy(((struct Data *
by jburgess777 9y ago
I think you underestimate current C compilers. GCC with -D_FORTIFY_SOURCE=2 successfully detect a buffer overflow at runtime when doing:
strcpy(((struct Data *)data.next)->name, string_pointer)
If the compiler knows the size of the input string at compile time then you will get also a warning during the compilation:
/usr/include/bits/string3.h:110:10: warning: call to __builtin___memcpy_chk will always overflow destination buffer