VirtualBox

Ignore:
Timestamp:
Apr 22, 2009 1:46:32 PM (16 years ago)
Author:
vboxsync
Message:

vboxmod.c: Fixed AssertReturn, must recheck cb.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/module/vboxmod.c

    r19110 r19111  
    124124    /** HGCM connection ID */
    125125    uint32_t client_id;
    126 } hgcm_connections[MAX_HGCM_CONNECTIONS] 
     126} hgcm_connections[MAX_HGCM_CONNECTIONS]
    127127=
    128128{
     
    442442
    443443    AssertPtrReturn(ppBuf, -EINVAL);
    444     /* Empty buffers are allowed, but then the user pointer should be NULL */
    445     AssertReturn(((cb > 0) && VALID_PTR(pUser)) || (pUser == NULL), -EINVAL);
     444    /* Empty buffers are allowed, but then the user pointer should be NULL. */
     445    AssertReturn((cb > 0 && VALID_PTR(pUser)) || (cb == 0 && pUser == NULL),
     446                 -EINVAL);
    446447
    447448    pBuf = RTMemAlloc(sizeof(*pBuf));
     
    961962
    962963    /* Deal with variable size ioctls first. */
    963 #ifdef DEBUG  /* Only allow random user applications to spam the log in 
     964#ifdef DEBUG  /* Only allow random user applications to spam the log in
    964965               * debug additions builds */
    965966    if (   VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_LOG(0))
     
    16521653            rcVBox = VbglGRPerform(&infoReq->header);
    16531654        }
    1654         if (   infoReq 
    1655             && (   RT_FAILURE(rcVBox) 
     1655        if (   infoReq
     1656            && (   RT_FAILURE(rcVBox)
    16561657                || RT_FAILURE(infoReq->header.rc)))
    16571658        {
Note: See TracChangeset for help on using the changeset viewer.

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