VirtualBox

Changeset 67151 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
May 31, 2017 7:12:18 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115827
Message:

Runtime/r3/socket: when checking for select() results it is possible that pThis->hNative became invalid in the meantimebecause the socket was closed, see rtSocketCloseIt() where we invalid pThis->hNative first and then close the socket. We could also remember hNative for the correct test after select() but I don't think we really care about the RTSOCKET_EVT_READ result on closed sockets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r66862 r67151  
    15451545    if (rc > 0)
    15461546    {
    1547         if (FD_ISSET(pThis->hNative, &fdsetR))
    1548             *pfEvents |= RTSOCKET_EVT_READ;
    1549         if (FD_ISSET(pThis->hNative, &fdsetW))
    1550             *pfEvents |= RTSOCKET_EVT_WRITE;
    1551         if (FD_ISSET(pThis->hNative, &fdsetE))
    1552             *pfEvents |= RTSOCKET_EVT_ERROR;
     1547        if (pThis->hNative != NIL_RTSOCKETNATIVE)
     1548        {
     1549            if (FD_ISSET(pThis->hNative, &fdsetR))
     1550                *pfEvents |= RTSOCKET_EVT_READ;
     1551            if (FD_ISSET(pThis->hNative, &fdsetW))
     1552                *pfEvents |= RTSOCKET_EVT_WRITE;
     1553            if (FD_ISSET(pThis->hNative, &fdsetE))
     1554                *pfEvents |= RTSOCKET_EVT_ERROR;
     1555        }
    15531556
    15541557        rc = VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette