aboutsummaryrefslogtreecommitdiff
path: root/overflow_function.c
diff options
context:
space:
mode:
Diffstat (limited to 'overflow_function.c')
-rw-r--r--overflow_function.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/overflow_function.c b/overflow_function.c
new file mode 100644
index 0000000..6d6e950
--- /dev/null
+++ b/overflow_function.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+void stupid(char *str)
+{
+ char buf[30];
+ /* exploitable function */
+ strcpy(buf, str);
+}
+
+int main(int argc, char **argv)
+{
+ stupid(argv[1]);
+ return 0;
+}