don't use strcpy to copy between overlapping strings, it's undefined operation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -178,7 +178,10 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream)
|
||||
if ( (*q == '*') && (*(q + 1) == '/') )
|
||||
break;
|
||||
}
|
||||
strcpy(p, q + 2);
|
||||
|
||||
// memmove allows overlaps (unlike strcpy):
|
||||
size_t cpylen = strlen(q + 2) + 1;
|
||||
memmove(p, q + 2, cpylen);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user