Skip to content

Instantly share code, notes, and snippets.

@suminb
Last active December 30, 2015 17:59
Show Gist options
  • Save suminb/7865038 to your computer and use it in GitHub Desktop.
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.
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