VirtualBox

Changeset 42077 in vbox for trunk/src


Ignore:
Timestamp:
Jul 10, 2012 8:37:08 AM (13 years ago)
Author:
vboxsync
Message:

Runtime/Process: Missing changes, relax the parameter checks for RTProcQueryUsername

Location:
trunk/src/VBox/Runtime/r3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/process-posix.cpp

    r41919 r42077  
    151151                                  size_t *pcbUser)
    152152{
    153     AssertPtrReturn(pszUser, VERR_INVALID_POINTER);
    154     AssertReturn(cbUser > 0, VERR_INVALID_PARAMETER);
    155     AssertPtrReturn(pcbUser, VERR_INVALID_POINTER);
     153    AssertReturn(   (pszUser && cbUser > 0)
     154                 || (!pszUser && !cbUser), VERR_INVALID_PARAMETER);
    156155
    157156    if (hProcess != RTProcSelf())
     
    172171        size_t cbPwdUser = strlen(pPwd->pw_name) + 1;
    173172
    174         *pcbUser = cbPwdUser;
     173        if (pcbUser)
     174            *pcbUser = cbPwdUser;
    175175
    176176        if (cbPwdUser > cbUser)
  • trunk/src/VBox/Runtime/r3/win/process-win.cpp

    r41919 r42077  
    14291429                                  size_t *pcbUser)
    14301430{
    1431     AssertPtrReturn(pszUser, VERR_INVALID_POINTER);
    1432     AssertReturn(cbUser > 0, VERR_INVALID_PARAMETER);
    1433     AssertPtrReturn(pcbUser, VERR_INVALID_POINTER);
     1431    AssertReturn(   (pszUser && cbUser > 0)
     1432                 || (!pszUser && !cbUser), VERR_INVALID_PARAMETER);
    14341433
    14351434    if (hProcess != RTProcSelf())
     
    14481447        size_t cbUserName = strlen(pszUserName) + 1;
    14491448
    1450         *pcbUser = cbUserName;
     1449        if (pcbUser)
     1450            *pcbUser = cbUserName;
    14511451
    14521452        if (cbUserName > cbUser)
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