mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Fix #77297: SodiumException segfaults on PHP 7.3
Instead of trying to clean the argument arrays from the backtrace, we overwrite them with empty arrays.
This commit is contained in:
parent
0061db5503
commit
e0e08d376e
3 changed files with 17 additions and 3 deletions
3
NEWS
3
NEWS
|
@ -54,6 +54,9 @@ PHP NEWS
|
||||||
. Fixed bug #77136 (Unsupported IPV6_RECVPKTINFO constants on macOS).
|
. Fixed bug #77136 (Unsupported IPV6_RECVPKTINFO constants on macOS).
|
||||||
(Mizunashi Mana)
|
(Mizunashi Mana)
|
||||||
|
|
||||||
|
- Sodium:
|
||||||
|
. Fixed bug #77297 (SodiumException segfaults on PHP 7.3). (Nikita, Scott)
|
||||||
|
|
||||||
- SQLite3:
|
- SQLite3:
|
||||||
. Fixed bug #77051 (Issue with re-binding on SQLite3). (BohwaZ)
|
. Fixed bug #77051 (Issue with re-binding on SQLite3). (BohwaZ)
|
||||||
|
|
||||||
|
|
|
@ -387,9 +387,8 @@ static void sodium_remove_param_values_from_backtrace(zend_object *obj) {
|
||||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(trace), frame) {
|
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(trace), frame) {
|
||||||
if (Z_TYPE_P(frame) == IS_ARRAY) {
|
if (Z_TYPE_P(frame) == IS_ARRAY) {
|
||||||
zval *args = zend_hash_str_find(Z_ARRVAL_P(frame), "args", sizeof("args")-1);
|
zval *args = zend_hash_str_find(Z_ARRVAL_P(frame), "args", sizeof("args")-1);
|
||||||
if (args && Z_TYPE_P(frame) == IS_ARRAY) {
|
zval_ptr_dtor(args);
|
||||||
zend_hash_clean(Z_ARRVAL_P(args));
|
ZVAL_EMPTY_ARRAY(args);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} ZEND_HASH_FOREACH_END();
|
} ZEND_HASH_FOREACH_END();
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,17 @@ if (defined('SODIUM_BASE64_VARIANT_ORIGINAL')) {
|
||||||
var_dump('abcd');
|
var_dump('abcd');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sodium_foo()
|
||||||
|
{
|
||||||
|
throw new SodiumException('test');
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
sodium_foo();
|
||||||
|
} catch (SodiumException $ex) {
|
||||||
|
var_dump($ex->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
0
|
0
|
||||||
|
@ -114,3 +125,4 @@ string(25) "base64("O1R") case passed"
|
||||||
string(24) "base64("O1") case passed"
|
string(24) "base64("O1") case passed"
|
||||||
string(23) "base64("O") case passed"
|
string(23) "base64("O") case passed"
|
||||||
string(4) "abcd"
|
string(4) "abcd"
|
||||||
|
string(4) "test"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue