diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2017-04-13 03:57:20 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2017-04-13 03:57:20 +0200 |
commit | 315745e24bf37a5fd8324e737272dc4b594dfd7e (patch) | |
tree | 05bd3769284f7d592b4ea11544532503a3f9299c /overflow.c | |
parent | bd131dc1d623c0708619ec95c5ece591e3462e89 (diff) |
return adr finder
Diffstat (limited to 'overflow.c')
-rw-r--r-- | overflow.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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); |