From 85b345da0924bec9a8a6fc7f92143232081a8926 Mon Sep 17 00:00:00 2001 From: Omar Santos Date: Mon, 22 Feb 2021 13:15:53 -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 95ffa7b..c94d499 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.