Created
February 24, 2012 00:14
-
-
Save manlycode/1896012 to your computer and use it in GitHub Desktop.
Can I use a buffer overflow exploit with this code, or is it secure?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int truncate_and_call(fn_ptr *fns, int index, char *user_string) | |
{ | |
char buf[64]; | |
// Truncate supplied string | |
strncpy(buf, user_string, sizeof(buf) - 1); | |
buf[sizeof(buf) - 1] = '\0'; | |
return fns[index](buf); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment