VirtualBox

Ignore:
Timestamp:
Jun 23, 2009 3:34:25 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48992
Message:

Webservice: handle NULL pointer object arguments in methods and return values correctly, both in raw webservice and OO JAX-WS wrappers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/vboxweb.cpp

    r18265 r20851  
    11071107 */
    11081108int ManagedObjectRef::findRefFromId(const WSDLT_ID &id,
    1109                                     ManagedObjectRef **pRef)
     1109                                    ManagedObjectRef **pRef,
     1110                                    bool fNullAllowed)
    11101111{
    11111112    int rc = 0;
     
    11131114    do
    11141115    {
     1116        // allow NULL (== empty string) input reference, which should return a NULL pointer
     1117        if (!id.length() && fNullAllowed)
     1118        {
     1119            *pRef = NULL;
     1120            return 0;
     1121        }
     1122
    11151123        uint64_t sessid;
    11161124        uint64_t objid;
     
    11791187    do {
    11801188        ManagedObjectRef *pRef;
    1181         if (!ManagedObjectRef::findRefFromId(req->_USCOREthis, &pRef))
     1189        if (!ManagedObjectRef::findRefFromId(req->_USCOREthis, &pRef, false))
    11821190            resp->returnval = pRef->getInterfaceName();
    11831191
     
    12101218    do {
    12111219        ManagedObjectRef *pRef;
    1212         if ((rc = ManagedObjectRef::findRefFromId(req->_USCOREthis, &pRef)))
     1220        if ((rc = ManagedObjectRef::findRefFromId(req->_USCOREthis, &pRef, false)))
    12131221        {
    12141222            RaiseSoapInvalidObjectFault(soap, req->_USCOREthis);
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