Bug 705875 - Check for null IID pointers and references in XPCConvert. r=khuey

This is a regression from http://hg.mozilla.org/mozilla-central/rev/c428312abbc7 . The rest of the changes in that patch should be fine.
This commit is contained in:
Bobby Holley 2011-12-01 18:24:28 -08:00
parent 560700472e
commit f2a42e56dd
3 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,7 @@
<!DOCTYPE html>
<script>
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
window.getInterface(null);
</script>

View File

@ -34,3 +34,4 @@ load 608963.html
load 616930-1.html
load 639737-1.html
load 648206-1.html
load 705875.html

View File

@ -601,9 +601,11 @@ XPCConvert::JSData2Native(XPCCallContext& ccx, void* d, jsval s,
JSObject* obj;
const nsID* pid=nsnull;
// There's no good reason to pass a null IID.
if (JSVAL_IS_VOID(s) || JSVAL_IS_NULL(s)) {
*((const nsID**)d) = nsnull;
return true;
if (pErr)
*pErr = NS_ERROR_XPC_BAD_CONVERT_JS;
return false;
}
if (!JSVAL_IS_OBJECT(s) ||