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 @@ -1628,7 +1628,7 @@ PHP_METHOD(SimpleXMLElement, getName)
16281628 node = php_sxe_get_first_node_non_destructive (sxe , node );
16291629 if (node ) {
16301630 namelen = xmlStrlen (node -> name );
1631- RETURN_STRINGL (( char * ) node -> name , namelen );
1631+ RETURN_STRINGL_FAST (( const char * ) node -> name , namelen );
16321632 } else {
16331633 RETURN_EMPTY_STRING ();
16341634 }
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-19988 (zend_string_init with NULL pointer in simplexml (UB))
3+ --EXTENSIONS--
4+ simplexml
5+ xsl
6+ --CREDITS--
7+ YuanchengJiang
8+ --FILE--
9+ <?php
10+ $ sxe = simplexml_load_file (__DIR__ . '/53965/collection.xml ' );
11+ $ processor = new XSLTProcessor ;
12+ $ dom = new DOMDocument ;
13+ $ dom ->load (__DIR__ . '/53965/collection.xsl ' );
14+ $ processor ->importStylesheet ($ dom );
15+ $ result = $ processor ->transformToDoc ($ sxe , SimpleXMLElement::class);
16+ var_dump ($ result ->getName ());
17+ ?>
18+ --EXPECT--
19+ string(0) ""
You can’t perform that action at this time.
0 commit comments