[php-src] master: Merge branch 'PHP-8.3'
| From: | Niels Dossche | Date: | Mon, 08 Apr 2024 17:31:22 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.3' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127987@lists.php.net to get a copy of this message | ||
Author: Niels Dossche (nielsdos)
Date: 2024-04-08T19:31:20+02:00
Commit: https://github.com/php/php-src/commit/9b5749a97ec4aa35dee9d735854bffcd6d7c230f
Raw diff: https://github.com/php/php-src/commit/9b5749a97ec4aa35dee9d735854bffcd6d7c230f.diff
Merge branch 'PHP-8.3'
* PHP-8.3:
Fix potential NULL pointer dereference before calling EVP_SignInit
Changed paths:
M ext/phar/util.c
Diff:
diff --git a/ext/phar/util.c b/ext/phar/util.c
index 70b475aa7485a..04efe89d8fc41 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -1890,6 +1890,13 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char
**signat
}
md_ctx = EVP_MD_CTX_create();
+ if (md_ctx == NULL) {
+ EVP_PKEY_free(key);
+ if (error) {
+ spprintf(error, 0, "unable to initialize openssl signature for phar
\"%s\"", phar->fname);
+ }
+ return FAILURE;
+ }
siglen = EVP_PKEY_size(key);
sigbuf = emalloc(siglen + 1);