Skip to content

Segmentation fault (null pointer dereference) in ext/standard/url_scanner_ex.re #15179

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
  for ($i=0; $i<=$mb; $i++) {
    $var.= str_repeat('a',1*1024*1024);
  }
  $x=$var;
  output_add_rewrite_var($x,$x);

Resulted in this output:

Segmentation fault (core dumped)

UBSan:

ext/standard/url_scanner_ex.re:695:6: runtime error: member access within null pointer of type 'zend_string' (aka 'struct _zend_string')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ext/standard/url_scanner_ex.re:695:6

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions