diff --git a/buffer_overflow_example/strcpy_example.md b/buffer_overflow_example/strcpy_example.md index f4d826c..b3910e6 100644 --- a/buffer_overflow_example/strcpy_example.md +++ b/buffer_overflow_example/strcpy_example.md @@ -36,6 +36,7 @@ int omarsucks() ``` The following is the stack layout for the code above: + The local array `buffer[] in `omarsucks()` has 12 bytes of memory. The `omarsucks()` function uses `strcpy()` to copy the string from `str` to `buffer[]`. The `strcpy()` function does not stop until it sees a zero (a number zero, `'\0'`) in the source string. Since the source string is longer than 12 bytes, `strcpy()` will overwrite some portion of the stack above the buffer. This is called buffer overflow.