VirtualBox

Ignore:
Timestamp:
Jul 5, 2007 8:14:18 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22642
Message:

Fixed issue with NULL parameter passing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/service.cpp

    r3428 r3432  
    210210            if (    paParms[0].type != VBOX_HGCM_SVC_PARM_PTR       /* pCmdBuffer */
    211211                ||  paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT     /* cCommands */
    212                 ||  paParms[2].type != VBOX_HGCM_SVC_PARM_PTR       /* pLastParam */
     212                ||  (    paParms[2].type != VBOX_HGCM_SVC_PARM_PTR       /* pLastParam */
     213                     &&  paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT)    /* pLastParam if NULL */
    213214                ||  paParms[3].type != VBOX_HGCM_SVC_PARM_64BIT     /* retval */
    214215                ||  paParms[4].type != VBOX_HGCM_SVC_PARM_32BIT     /* lasterror */
     
    227228
    228229                /* Save the last parameter of the last command in the client structure so the macro can pick it up there */
    229                 pClient->pLastParam  = (uint8_t *)paParms[2].u.pointer.addr;
    230                 pClient->cbLastParam = paParms[2].u.pointer.size;
     230                if (paParms[2].type == VBOX_HGCM_SVC_PARM_32BIT)
     231                {
     232                    pClient->pLastParam  = NULL;
     233                    pClient->cbLastParam = 0;
     234                }
     235                else
     236                {
     237                    pClient->pLastParam  = (uint8_t *)paParms[2].u.pointer.addr;
     238                    pClient->cbLastParam = paParms[2].u.pointer.size;
     239                }
    231240
    232241                /* Execute the function. */
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