[php-src] Issue #7809: Segmentation fault @ PHP 8.1

From: Date: Wed, 22 Dec 2021 12:59:06 +0000
Subject: [php-src] Issue #7809: Segmentation fault @ PHP 8.1
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238536@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7809 Comment Author: cmb69 Relevant part of the stack backtrace: ```` php8_debug.dll!spl_filesystem_object_clone(_zend_object * old_object) Line 360 (c:\php-sdk\phpdev\vs16\x64\php-src-8.0\ext\spl\spl_directory.c:360) php8_debug.dll!ZEND_CLONE_SPEC_CV_HANDLER(_zend_execute_data * execute_data) Line 38008 (c:\php-sdk\phpdev\vs16\x64\php-src-8.0\Zend\zend_vm_execute.h:38008) php8_debug.dll!execute_ex(_zend_execute_data * ex) Line 54509 (c:\php-sdk\phpdev\vs16\x64\php-src-8.0\Zend\zend_vm_execute.h:54509) php8_debug.dll!zend_execute(_zend_op_array * op_array, _zval_struct * return_value) Line 59051 (c:\php-sdk\phpdev\vs16\x64\php-src-8.0\Zend\zend_vm_execute.h:59051) php8_debug.dll!zend_execute_scripts(int type, _zval_struct * retval, int file_count, ...) Line 1681 (c:\php-sdk\phpdev\vs16\x64\php-src-8.0\Zend\zend.c:1681) php8_debug.dll!php_execute_script(_zend_file_handle * primary_file) Line 2539 (c:\php-sdk\phpdev\vs16\x64\php-src-8.0\main\main.c:2539) ```` The problem is at https://github.com/php/php-src/blob/713dcb28181895d241e6dbe63f63ee654ba757b4/ext/spl/spl_directory.c#L388 source->path is NULL, and zend_string_copy() can't handle that. Prior to https://github.com/php/php-src/commit/13e4ce386bb7257dbbe3167b070382ea959ec763, there were no zend_strings but rather char*s so no problem with PHP 8.0.

« previous php.bugs (#238536) next »