X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a2d452d042ef1e2a6a17dcbc271183b947669bb3..a290fa5a7deebe9d96c0c0089d18e27d4bd9b624:/src/common/xpmdecod.cpp?ds=sidebyside diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index cc0e2bad48..f8524971a0 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -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); } /* @@ -236,11 +239,7 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream) */ wxImage img = ReadData(xpm_lines); -#ifdef __WIN16__ - delete[] (char**) xpm_lines; -#else delete[] xpm_lines; -#endif return img; }