Skip to content

Segmentation fault in ext/xmlreader/php_xmlreader.c:1282 #16292

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
$character_data = new DOMCharacterData();
$fusion = $character_data;
$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
<books><book>new book</book></books>';
$reader = new XMLReader();
$reader->XML($xmlstring);
while ($reader->read()) {
if ($reader->localName == "book") {
$node = $reader->expand($fusion);
}
}

Resulted in this output:

/php-src/ext/xmlreader/php_xmlreader.c:1282:3: runtime error: member access within misaligned address 0x000000000001 for type 'zend_class_entry' (aka 'struct _zend_class_entry'), which requires 8 byte alignment
0x000000000001: note: pointer points here
<memory cannot be printed>
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/xmlreader/php_xmlreader.c:1282:3

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions