mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Possible fix for bug #26281 & test case.
This commit is contained in:
parent
a16ca5a1c2
commit
fdd902f0dd
13
Zend/tests/bug26281.phpt
Executable file
13
Zend/tests/bug26281.phpt
Executable file
@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #26281 (switch() crash when condition is a string offset)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = 'abc';
|
||||
switch ($x{0}) {
|
||||
case 'a':
|
||||
echo "no crash\n";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
no crash
|
@ -200,7 +200,9 @@ static inline void zend_switch_free(zend_op *opline, temp_variable *Ts TSRMLS_DC
|
||||
* quick & silent get_zval_ptr, and FREE_OP
|
||||
*/
|
||||
PZVAL_UNLOCK(T->EA.data.str_offset.str);
|
||||
#ifdef ilia_0 /* attempts to free already freed data */
|
||||
zval_dtor(&T->tmp_var);
|
||||
#endif
|
||||
} else {
|
||||
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
|
||||
if (opline->extended_value) { /* foreach() free */
|
||||
|
Loading…
Reference in New Issue
Block a user