Skip to content

Commit 63e6792

Browse files
authored
memmove() instead of strcpy() (#36)
Here we strcpy() into overlapping memory which is undefined behavior. Use memmove() instead which allows overlapping areas.
1 parent 0657bb0 commit 63e6792

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/netmsg_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void Info_RemoveKey(char *s, char *key)
102102

103103
if (!strcmp(key, pkey))
104104
{
105-
strcpy(start, s); // Remove this part.
105+
memmove(start, s, strlen(s)+1); // Remove this part.
106106
return;
107107
}
108108

0 commit comments

Comments
 (0)