- Standard:
. Don't force rebuild of symbol table, when populating $http_response_header
variable by the HTTP stream wrapper. (Dmitry)
+ . Fixed bug #80290 (Double free when ASSERT_CALLBACK is used with a dynamic
+ message). (Nikita)
29 Oct 2020, PHP 8.0.0RC3
if (description_str) {
ZVAL_STR(&args[3], description_str);
call_user_function(NULL, NULL, &ASSERTG(callback), &retval, 4, args);
- zval_ptr_dtor(&(args[3]));
- zval_ptr_dtor(&(args[2]));
- zval_ptr_dtor(&(args[0]));
} else {
call_user_function(NULL, NULL, &ASSERTG(callback), &retval, 3, args);
- zval_ptr_dtor(&(args[2]));
- zval_ptr_dtor(&(args[0]));
}
+ zval_ptr_dtor(&args[0]);
zval_ptr_dtor(&retval);
}
--- /dev/null
+--TEST--
+Bug #80290: Double free when ASSERT_CALLBACK is used with a dynamic message
+--FILE--
+<?php
+
+assert_options(ASSERT_CALLBACK, function($file, $line, $unused, $message) {
+ var_dump($message);
+});
+
+$x = 'x';
+assert(false, 'Dynamic message: ' . $x);
+
+?>
+--EXPECTF--
+string(18) "Dynamic message: x"
+
+Fatal error: Uncaught AssertionError: Dynamic message: x in %s:%d
+Stack trace:
+#0 %s(%d): assert(false, 'Dynamic message...')
+#1 {main}
+ thrown in %s on line %d