1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00

Merge branch 'PHP-7.3'

* PHP-7.3:
  Fix #77297: SodiumException segfaults on PHP 7.3
This commit is contained in:
Christoph M. Becker
2018-12-16 16:37:15 +01:00
2 changed files with 14 additions and 3 deletions

View File

@@ -387,9 +387,8 @@ static void sodium_remove_param_values_from_backtrace(zend_object *obj) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(trace), frame) {
if (Z_TYPE_P(frame) == IS_ARRAY) {
zval *args = zend_hash_str_find(Z_ARRVAL_P(frame), "args", sizeof("args")-1);
if (args && Z_TYPE_P(frame) == IS_ARRAY) {
zend_hash_clean(Z_ARRVAL_P(args));
}
zval_ptr_dtor(args);
ZVAL_EMPTY_ARRAY(args);
}
} ZEND_HASH_FOREACH_END();
}

View File

@@ -93,6 +93,17 @@ if (defined('SODIUM_BASE64_VARIANT_ORIGINAL')) {
var_dump('base64("O") case passed');
var_dump('abcd');
}
function sodium_foo()
{
throw new SodiumException('test');
}
try {
sodium_foo();
} catch (SodiumException $ex) {
var_dump($ex->getMessage());
}
?>
--EXPECT--
@@ -114,3 +125,4 @@ string(25) "base64("O1R") case passed"
string(24) "base64("O1") case passed"
string(23) "base64("O") case passed"
string(4) "abcd"
string(4) "test"