summaryrefslogtreecommitdiff
path: root/ext/standard/password.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-11 10:21:31 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-11 10:21:31 +0100
commitcec5e308899febe5692d34c8c5b78e6773284e45 (patch)
treee7ae0662a1b21d360899607659683c1c320085c2 /ext/standard/password.c
parentd80d918547b676e78ccf096a24069a8b2e5dd96b (diff)
downloadphp-git-cec5e308899febe5692d34c8c5b78e6773284e45.tar.gz
Don't return null from password_get_info()
The get_info() handler should never fail, but even if it does, we should still return a proper info array -- it doesn't make sense that a completely incorrect hash returns an info array, but a hash that is recognized but for which the options can't be extracted would return null.
Diffstat (limited to 'ext/standard/password.c')
-rw-r--r--ext/standard/password.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/standard/password.c b/ext/standard/password.c
index a19266d214..c108f8d71a 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -584,11 +584,8 @@ PHP_FUNCTION(password_get_info)
zend_string_release(ident);
add_assoc_string(return_value, "algoName", algo->name);
- if (algo->get_info &&
- (FAILURE == algo->get_info(&options, hash))) {
- zval_ptr_dtor_nogc(&options);
- zval_ptr_dtor_nogc(return_value);
- RETURN_NULL();
+ if (algo->get_info) {
+ algo->get_info(&options, hash);
}
add_assoc_zval(return_value, "options", &options);
}