mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
560700472e
commit
f2a42e56dd
7
js/xpconnect/crashtests/705875.html
Normal file
7
js/xpconnect/crashtests/705875.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
|
||||
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
window.getInterface(null);
|
||||
|
||||
</script>
|
@ -34,3 +34,4 @@ load 608963.html
|
||||
load 616930-1.html
|
||||
load 639737-1.html
|
||||
load 648206-1.html
|
||||
load 705875.html
|
||||
|
@ -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) ||
|
||||
|
Loading…
Reference in New Issue
Block a user