mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fix GH-13680: Segfault with session_decode and compilation error
This commit is contained in:
commit
8793f9938b
2 changed files with 28 additions and 2 deletions
|
@ -272,16 +272,17 @@ static zend_result php_session_decode(zend_string *data) /* {{{ */
|
||||||
php_error_docref(NULL, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object");
|
php_error_docref(NULL, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object");
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
zend_result result = SUCCESS;
|
||||||
zend_try {
|
zend_try {
|
||||||
if (PS(serializer)->decode(ZSTR_VAL(data), ZSTR_LEN(data)) == FAILURE) {
|
if (PS(serializer)->decode(ZSTR_VAL(data), ZSTR_LEN(data)) == FAILURE) {
|
||||||
php_session_cancel_decode();
|
php_session_cancel_decode();
|
||||||
return FAILURE;
|
result = FAILURE;
|
||||||
}
|
}
|
||||||
} zend_catch {
|
} zend_catch {
|
||||||
php_session_cancel_decode();
|
php_session_cancel_decode();
|
||||||
zend_bailout();
|
zend_bailout();
|
||||||
} zend_end_try();
|
} zend_end_try();
|
||||||
return SUCCESS;
|
return result;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
25
ext/session/tests/gh13680.phpt
Normal file
25
ext/session/tests/gh13680.phpt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
--TEST--
|
||||||
|
GH-13680 (Segfault with session_decode and compilation error)
|
||||||
|
--EXTENSIONS--
|
||||||
|
session
|
||||||
|
--SKIPIF--
|
||||||
|
<?php include('skipif.inc'); ?>
|
||||||
|
--INI--
|
||||||
|
session.use_cookies=0
|
||||||
|
session.use_strict_mode=0
|
||||||
|
session.cache_limiter=
|
||||||
|
session.serialize_handler=php_serialize
|
||||||
|
session.save_handler=files
|
||||||
|
error_reporting=E_ALL
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
session_decode('foo');
|
||||||
|
class Test extends DateTime {
|
||||||
|
public static function createFromFormat($format, $datetime, $timezone = null): Wrong {}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
|
||||||
|
|
||||||
|
Fatal error: Could not check compatibility between Test::createFromFormat($format, $datetime, $timezone = null): Wrong and DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, because class Wrong is not available in %s on line %d
|
Loading…
Add table
Add a link
Reference in a new issue