Skip to content

Commit

Permalink
memmove() instead of strcpy() (#36)
Browse files Browse the repository at this point in the history
Here we strcpy() into overlapping memory which is undefined behavior. Use memmove() instead which allows overlapping areas.
  • Loading branch information
fzwoch committed Sep 22, 2023
1 parent 0657bb0 commit 63e6792
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/netmsg_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void Info_RemoveKey(char *s, char *key)

if (!strcmp(key, pkey))
{
strcpy(start, s); // Remove this part.
memmove(start, s, strlen(s)+1); // Remove this part.
return;
}

Expand Down

0 comments on commit 63e6792

Please sign in to comment.