]> git.saurik.com Git - wxWidgets.git/commitdiff
fix assert failure if NULL size pointer was passed to Request() (as happened in the...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 17 Nov 2008 11:12:34 +0000 (11:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 17 Nov 2008 11:12:34 +0000 (11:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sckipc.cpp

index b1223d249b3a8ae4bed4f34fee400534bbe8a19a..587268bda691cae461529cdfeb913ba7c7daeb26 100644 (file)
@@ -582,7 +582,11 @@ const void *wxTCPConnection::Request(const wxString& item,
     if ( ret != IPC_REQUEST_REPLY )
         return NULL;
 
-    return m_streams->ReadData(this, size);
+    // ReadData() needs a non-NULL size pointer but the client code can call us
+    // with NULL pointer (this makes sense if it knows that it always works
+    // with NUL-terminated strings)
+    size_t sizeFallback;
+    return m_streams->ReadData(this, size ? size : &sizeFallback);
 }
 
 bool wxTCPConnection::DoPoke(const wxString& item,