File tree 2 files changed +20
-1
lines changed 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -2619,7 +2619,7 @@ PHP_FUNCTION(simplexml_import_dom)
2619
2619
nodep = xmlDocGetRootElement ((xmlDocPtr ) nodep );
2620
2620
}
2621
2621
2622
- if (nodep -> type == XML_ELEMENT_NODE ) {
2622
+ if (nodep && nodep -> type == XML_ELEMENT_NODE ) {
2623
2623
if (!ce ) {
2624
2624
ce = sxe_class_entry ;
2625
2625
fptr_count = NULL ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ BUg #81325 (segfault in zif_simplexml_import_dom)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('simplexml ' )) die ('skip simplexml not available ' );
6
+ if (!extension_loaded ('dom ' )) die ('skip simplexml not available ' );
7
+ ?>
8
+ --FILE--
9
+ <?php
10
+ $ dom = new DOMDocument ;
11
+ $ dom ->loadXML ("foo " );
12
+ $ xml = simplexml_import_dom ($ dom );
13
+ ?>
14
+ Done
15
+ --EXPECTF--
16
+ Warning: DOMDocument::loadXML(): Start tag expected%s
17
+
18
+ Warning: simplexml_import_dom(): Invalid Nodetype%s
19
+ Done
You can’t perform that action at this time.
0 commit comments