From d56b2765eef2169fae8e834e52444e57b31d7a4f Mon Sep 17 00:00:00 2001 From: Omar Santos Date: Mon, 22 Feb 2021 13:16:17 -0500 Subject: [PATCH] Update strcpy_example.md --- buffer_overflow_example/strcpy_example.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buffer_overflow_example/strcpy_example.md b/buffer_overflow_example/strcpy_example.md index c94d499..f4d826c 100644 --- a/buffer_overflow_example/strcpy_example.md +++ b/buffer_overflow_example/strcpy_example.md @@ -36,7 +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.