Skip to content

Segmentation fault (access null pointer) in Zend/zend_API.h:84 #16359

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
$log_file = tempnam(sys_get_temp_dir(), 'php-curl-CURLOPT_WRITEFUNCTION-trampoline');
$fp = fopen($log_file, 'w+');
fwrite($fp, "test");
$ch = curl_init();
curl_setopt($ch, CURLOPT_WRITEFUNCTION, $fusion);
curl_setopt($ch, CURLOPT_URL, 'file://' . $log_file);
curl_exec($ch);

Resulted in this output:

/php-src/Zend/zend_API.h:847:6: runtime error: member access within null pointer of type 'zend_function' (aka 'union _zend_function')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/Zend/zend_API.h:847:6

PHP Version

nightly

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