Bug #79780 [NEW]: Stack overflow in zend_string_init

From: Date: Sat, 04 Jul 2020 00:34:43 +0000
Subject: Bug #79780 [NEW]: Stack overflow in zend_string_init
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227800@lists.php.net to get a copy of this message
From: changochen1 at gmail dot com Operating system: PHP version: 8.0Git-2020-07-04 (Git) Package: Scripting Engine problem Bug Type: Bug Bug description:Stack overflow in zend_string_init Description: ------------ Cmdline: php -f poc Stack dump: --- MemorySanitizer:DEADLYSIGNAL ==216578==ERROR: MemorySanitizer: stack-overflow on address 0x7ffc286a4cf8 (pc 0x00000044c652 bp 0x7ffc286a5540 sp 0x7ffc286a4ce0 T216578) #0 0x44c651 in __msan_memcpy.part.330 (/home/yongheng/php_clean/bld/sapi/cli/php+0x44c651) #1 0x134c0b4 in zend_string_init /home/yongheng/php_clean/Zend/zend_string.h:165:2 #2 0x134c0b4 in zend_long_to_str /home/yongheng/php_clean/Zend/zend_operators.c:2890 #3 0x134c0b4 in _convert_to_string /home/yongheng/php_clean/Zend/zend_operators.c:630 #4 0x138b210 in zend_parse_arg_str_weak /home/yongheng/php_clean/Zend/zend_API.c:493:3 #5 0x138b73c in zend_parse_arg_str_slow /home/yongheng/php_clean/Zend/zend_API.c:517:9 #6 0x1402966 in zend_parse_arg_str /home/yongheng/php_clean/Zend/zend_API.h:1784:10 #7 0x1402966 in class_exists_impl /home/yongheng/php_clean/Zend/zend_builtin_functions.c:1053 #8 0x15c5942 in ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER /home/yongheng/php_clean/Zend/zend_vm_execute.h:1236:2 #9 0x142669f in execute_ex /home/yongheng/php_clean/Zend/zend_vm_execute.h:51852:7 #10 0x132a6fa in zend_call_function /home/yongheng/php_clean/Zend/zend_execute_API.c:803:3 #11 0x132cb58 in zend_call_known_function /home/yongheng/php_clean/Zend/zend_execute_API.c:890:15 #12 0xd3cd88 in spl_perform_autoload /home/yongheng/php_clean/ext/spl/php_spl.c:447:3 #13 0x132e090 in zend_lookup_class_ex /home/yongheng/php_clean/Zend/zend_execute_API.c:1015:7 ... --- Test script: --------------- <? spl_autoload_register ( function () { static $a ; $a ++ ; class_exists ( $a ) ; } ) ; class_exists ( 'x' ) ; -- Edit bug report at https://bugs.php.net/bug.php?id=79780&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79780&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79780&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79780&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79780&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79780&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79780&r=support Expected behavior: https://bugs.php.net/fix.php?id=79780&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79780&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79780&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79780&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79780&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79780&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79780&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79780&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79780&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79780&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79780&r=mysqlcfg

« previous php.bugs (#227800) next »