]> git.saurik.com Git - wxWidgets.git/commitdiff
also initialize option value length before calling getsockopt()
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Dec 2008 00:21:28 +0000 (00:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Dec 2008 00:21:28 +0000 (00:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/socket.cpp

index b76cfe809a4c750dc45a083f68f0f24fb474e65e..20edac4d972b1bf93055be53f524c65521c238df 100644 (file)
@@ -1680,7 +1680,7 @@ bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen)
 {
     wxASSERT_MSG( m_impl, _T("Socket not initialised") );
 
-    SOCKOPTLEN_T lenreal;
+    SOCKOPTLEN_T lenreal = *optlen;
     if ( getsockopt(m_impl->m_fd, level, optname,
                     static_cast<char *>(optval), &lenreal) != 0 )
         return false;