An intended buffer overflow that does not always cause the program to crash
问题 Consider The following minimal C program: Case Number 1 : #include <stdio.h> #include <string.h> void foo(char* s) { char buffer[10]; strcpy(buffer,s); } int main(void) { foo("01234567890134567"); } This doesn't cause a crash dump If add just one character, so the new main is: Case Number 2 : void main() { foo("012345678901345678"); ^ } The program crashes with a Segmentation fault. Looks like additionally to the 10 characters reserved in the stack there's an additional room for 8 additional