- Fixed ext/mysqli to allocate less memory when fetching bound params
of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
- Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
+- Fixed bug #33116 (crash when assigning class name to global variable in
+ __autoload). (Dmitry)
- Fixed bug #33090 (mysqli_prepare() doesn't return an error). (Georg)
- Fixed bug #33076 (str_ireplace() incorrectly counts result string length
and may cause segfault). (Tony)
--- /dev/null
+--TEST--
+Bug #33116 (crash when assigning class name to global variable in __autoload)
+--FILE--
+<?php
+function __autoload($class)
+{
+ $GLOBALS['include'][] = $class;
+ eval("class DefClass{}");
+}
+
+$a = new DefClass;
+print_r($a);
+print_r($GLOBALS['include']);
+?>
+--EXPECT--
+DefClass Object
+(
+)
+Array
+(
+ [0] => DefClass
+)
{
zval **args[1];
zval autoload_function;
- zval class_name, *class_name_ptr = &class_name;
+ zval *class_name_ptr;
zval *retval_ptr;
int retval;
char *lc_name;
ZVAL_STRINGL(&autoload_function, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1, 0);
+ ALLOC_ZVAL(class_name_ptr);
INIT_PZVAL(class_name_ptr);
- ZVAL_STRINGL(class_name_ptr, name, name_length, 0);
+ ZVAL_STRINGL(class_name_ptr, name, name_length, 1);
args[0] = &class_name_ptr;
EG(exception) = NULL;
retval = call_user_function_ex(EG(function_table), NULL, &autoload_function, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
+ zval_ptr_dtor(&class_name_ptr);
+
zend_hash_del(EG(in_autoload), lc_name, name_length+1);
if (retval == FAILURE) {