File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -2635,7 +2635,7 @@ PHP_FUNCTION(simplexml_import_dom)
2635
2635
nodep = xmlDocGetRootElement ((xmlDocPtr ) nodep );
2636
2636
}
2637
2637
2638
- if (nodep -> type == XML_ELEMENT_NODE ) {
2638
+ if (nodep && nodep -> type == XML_ELEMENT_NODE ) {
2639
2639
if (!ce ) {
2640
2640
ce = sxe_class_entry ;
2641
2641
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