also initialize option value length before calling getsockopt()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user