1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3'

* PHP-8.3:
  Fix potential NULL pointer dereference before calling EVP_SignInit
This commit is contained in:
Niels Dossche
2024-04-08 19:31:20 +02:00

View File

@@ -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);