[php-src] master: Merge branch 'PHP-8.6'
| From: | ndossche | Date: | Tue, 29 Sep 2026 18:40:49 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141716@lists.php.net to get a copy of this message | ||
Author: ndossche (ndossche)
Date: 2026-09-29T20:40:36+02:00
Commit: https://github.com/php/php-src/commit/266c84c17c94ffc27bea4f11160dd877e5ca5fed
Raw diff: https://github.com/php/php-src/commit/266c84c17c94ffc27bea4f11160dd877e5ca5fed.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
openssl: Fix memory leak by doing early salt validation
Changed paths:
M ext/openssl/openssl.c
Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 3fcb34e9b801..b05ee7418d0c 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4555,6 +4555,8 @@ PHP_FUNCTION(openssl_sign)
Z_PARAM_LONG(salt_length)
ZEND_PARSE_PARAMETERS_END();
+ PHP_OPENSSL_CHECK_LONG_TO_INT(salt_length, salt_length, 6);
+
pkey = php_openssl_pkey_from_zval(key, 0, "", 0, 3);
if (pkey == NULL) {
if (!EG(exception)) {
@@ -4573,7 +4575,6 @@ PHP_FUNCTION(openssl_sign)
php_error_docref(NULL, E_WARNING, "Unknown digest algorithm");
RETURN_FALSE;
}
- PHP_OPENSSL_CHECK_LONG_TO_INT(salt_length, salt_length, 6);
md_ctx = EVP_MD_CTX_create();
size_t siglen;