Skip to content

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

Closed

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

Activity

  1. added a commit that references this issue on Oct 8, 2024
    0e80541
  2. added 4 commits that reference this issue on Oct 8, 2024
    54eab7b
    1f84f5c
    dd0ced3
    5c12493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions