]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ffile.cpp
fixing overrelease and out-of-bounds write, fixes #13725
[wxWidgets.git] / src / common / ffile.cpp
index 5212066a637bb7a9eb41c7f384ecc1efaf19886c..ae196692041bcc9726fc2c5f530a178e5e394841 100644 (file)
@@ -117,7 +117,9 @@ bool wxFFile::ReadAll(wxString *str, const wxMBConv& conv)
     }
 
     buf.data()[length] = 0;
-    *str = wxString(buf, conv);
+
+    wxString strTmp(buf, conv);
+    str->swap(strTmp);
 
     return true;
 }