]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mstream.cpp
fixing overrelease and out-of-bounds write, fixes #13725
[wxWidgets.git] / src / common / mstream.cpp
index 5ecc10f704107eee11b5abbf57bda6de4e6e240f..66af403e2f8140fe46874da4ddd3dcf8902f4cd1 100644 (file)
@@ -47,7 +47,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxMemoryInputStream, wxInputStream)
 wxMemoryInputStream::wxMemoryInputStream(const void *data, size_t len)
 {
     m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
-    m_i_streambuf->SetBufferIO((void *)data, len); // const_cast
+    m_i_streambuf->SetBufferIO(const_cast<void *>(data), len);
     m_i_streambuf->SetIntPosition(0); // seek to start pos
     m_i_streambuf->Fixed(true);