Skip to content

Commit 5bacf21

Browse files
committed
Add more comments
1 parent e6b0564 commit 5bacf21

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

buffer_overflow/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CC=gcc
22
CFLAGS=-I.
33

4+
# Turns out modern compilers have a lot of default settings to prevent vulnerable code
5+
# -fno-stack-protector: Disable stack canary: https://ctf101.org/binary-exploitation/stack-canaries/
6+
# -no-pie: Disables ASLR essentially, loads executable to the same address every time
7+
# -Wno-stringop-overflow: Disable complaining about fgets overflow
48
buffer_overflow: buffer_overflow.c
59
$(CC) -o buffer_overflow buffer_overflow.c -fno-stack-protector -no-pie -Wno-stringop-overflow
610

buffer_overflow/buffer_overflow.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include <stdio.h> // for puts and gets
2-
#include <unistd.h>
1+
#include <stdio.h> // For puts and fgets
2+
#include <unistd.h> // For execve
33

44
void access_vault() {
55
puts("Access granted");

0 commit comments

Comments
 (0)