Last active
December 30, 2015 17:59
-
-
Save suminb/7865038 to your computer and use it in GitHub Desktop.
Explain why the following code does not (always) work. Discuss, if there is any, potential security vulnerabilities.
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
char* concat(char *s, char *t) { | |
char strbuf[BUF_SIZE]; | |
strcpy(strbuf, s); | |
strcpy(strbuf+strlen(s), t); | |
return strbuf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment