VirtualBox

Changeset 17381 in vbox for trunk


Ignore:
Timestamp:
Mar 5, 2009 10:11:15 AM (16 years ago)
Author:
vboxsync
Message:

XPCOM/IPC/DConnect: Return NS_ERROR_INVALID_POINTER instead of crash if a NULL pointer is passed as an input nsID parameter through an IPC method call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp

    r15985 r17381  
    344344
    345345    case nsXPTType::T_IID:
    346       writer.PutBytes(v.val.p, sizeof(nsID));
     346      {
     347        if (v.val.p)
     348          writer.PutBytes(v.val.p, sizeof(nsID));
     349        else
     350          return NS_ERROR_INVALID_POINTER;
     351      }
    347352      break;
    348353
     
    24082413
    24092414      if (NS_FAILED(rv))
    2410         return rv;
     2415        break;
    24112416    }
    24122417    else if ((paramInfo.IsOut() || paramInfo.IsRetval()) && !aParams[i].val.p)
    24132418    {
    24142419      // report error early if NULL pointer is passed as an output parameter
    2415       return NS_ERROR_NULL_POINTER;
    2416     }
     2420      rv = NS_ERROR_NULL_POINTER;
     2421      break;
     2422    }
     2423  }
     2424
     2425  if (NS_FAILED(rv))
     2426  {
     2427    // INVOKE message wasn't sent; clean up wrappers
     2428    dConnect->ReleaseWrappers(wrappers);
     2429    return rv;
    24172430  }
    24182431
     
    24312444                               aParams[i].val.p, wrappers);
    24322445      if (NS_FAILED(rv))
     2446      {
     2447        // INVOKE message wasn't sent; clean up wrappers
     2448        dConnect->ReleaseWrappers(wrappers);
    24332449        return rv;
     2450      }
    24342451    }
    24352452  }
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