aboutsummaryrefslogtreecommitdiff
path: root/overflow.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2017-04-13 03:57:20 +0200
committerToni Uhlig <matzeton@googlemail.com>2017-04-13 03:57:20 +0200
commit315745e24bf37a5fd8324e737272dc4b594dfd7e (patch)
tree05bd3769284f7d592b4ea11544532503a3f9299c /overflow.c
parentbd131dc1d623c0708619ec95c5ece591e3462e89 (diff)
return adr finder
Diffstat (limited to 'overflow.c')
-rw-r--r--overflow.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/overflow.c b/overflow.c
index 8fb07b9..1d9e4cf 100644
--- a/overflow.c
+++ b/overflow.c
@@ -13,20 +13,19 @@
#define BUFLEN 300
void
-overflow(const char *src, char *dst)
+overflow(const char *src)
{
+ char buf[BUFLEN];
/* exploitable function */
- strcpy(dst, src);
+ strcpy(&buf[0], src);
/* nothing to do, just return */
}
int
main(int argc, char **argv)
{
- char buf[BUFLEN];
-
if (argc > 1) {
- overflow(argv[1], buf);
+ overflow(argv[1]);
} else {
fprintf(stderr, "arg1 missing\n");
return(1);