[php-src] Issue #20732: undefined behavior in phar

From: Date: Fri, 19 Dec 2025 13:54:30 +0000
Subject: [php-src] Issue #20732: undefined behavior in phar
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-251408@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/20732 Author: chongwick ### Description The following code: ```php <?php $v_3963 = $v_3963; $v_3964 = json_decode($v_3963,); $v_3965 = JSON_PRETTY_PRINT; $v_3966 = json_encode($v_3964,$v_3965,); $v_3966 = json_decode($v_3966,); $v_13995 = chdir($v_3966,); try{ $v_13510 = DIRECTORY_SEPARATOR; $v_13999 = Phar::LoadPhar($v_13510,$v_3964,); $v_14000 = 'OK\n'; } catch (PharException $e){ $v_13996 = $e->getMessage(); } ``` Resulted in this output: ``` /home/w023dtc/nightly_php/php-src/ext/phar/phar.c:1723:70: runtime error: index 18446744073709551615 out of bounds for type 'char [1043]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/w023dtc/nightly_php/php-src/ext/phar/phar.c:1723:70 ``` ### PHP Version ```plain nightly ``` ### Operating System ubuntu 22.04

« previous php.bugs (#251408) next »