mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1361892 - Null check pointer before calling Release. r=erahm.
--HG-- extra : rebase_source : b80444629fc5cf92431297fd3bae61f805537162
This commit is contained in:
parent
d2f951ca78
commit
c2849d4c0b
23
dom/xslt/crashtests/1361892.html
Normal file
23
dom/xslt/crashtests/1361892.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<script id=o_xml type="text/plain"><?xml version="1.0" encoding="UTF-8"?>
|
||||
<tag_name/>
|
||||
</script>
|
||||
<script id=o_xslt type="text/plain"><?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="42">
|
||||
<xsl:template match="*">
|
||||
<xsl:value-of xmlns:regexp="http://exslt.org/regular-expressions" select="regexp:match('foo','bar','-2')"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
</script>
|
||||
<script>
|
||||
window.onload = function(){
|
||||
let doc = new DOMParser(), proc = new XSLTProcessor();
|
||||
proc.importStylesheet(doc.parseFromString(document.getElementById('o_xslt').textContent, "text/xml"));
|
||||
proc.transformToDocument(doc.parseFromString(document.getElementById('o_xml').textContent, "text/xml"));
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
@ -19,3 +19,4 @@ load 1089049.html
|
||||
load 1205163.xml
|
||||
load 1243337.xml
|
||||
load 1338277.html
|
||||
load 1361892.html
|
||||
|
@ -345,7 +345,9 @@ txParamArrayHolder::~txParamArrayHolder()
|
||||
variant.type.TagPart() == nsXPTType::T_INTERFACE_IS,
|
||||
"We only support cleanup of strings and interfaces "
|
||||
"here, and this looks like neither!");
|
||||
static_cast<nsISupports*>(variant.val.p)->Release();
|
||||
if (variant.val.p != nullptr) {
|
||||
static_cast<nsISupports*>(variant.val.p)->Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user