mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3' into PHP-8.4
This commit is contained in:
3
NEWS
3
NEWS
@@ -21,6 +21,9 @@ PHP NEWS
|
||||
. Fixed bug GH-19485 (potential use after free when using persistent pgsql
|
||||
connections). (Mark Karpeles)
|
||||
|
||||
- Phar:
|
||||
. Fixed memory leaks when verifying OpenSSL signature. (Girgias)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois)
|
||||
|
||||
|
||||
@@ -1952,6 +1952,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
|
||||
|
||||
if (!EVP_SignInit(md_ctx, mdtype)) {
|
||||
EVP_PKEY_free(key);
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
efree(sigbuf);
|
||||
if (error) {
|
||||
spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname);
|
||||
@@ -1962,6 +1963,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
|
||||
while ((sig_len = php_stream_read(fp, (char*)buf, sizeof(buf))) > 0) {
|
||||
if (!EVP_SignUpdate(md_ctx, buf, sig_len)) {
|
||||
EVP_PKEY_free(key);
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
efree(sigbuf);
|
||||
if (error) {
|
||||
spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname);
|
||||
@@ -1972,6 +1974,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
|
||||
|
||||
if (!EVP_SignFinal (md_ctx, sigbuf, &siglen, key)) {
|
||||
EVP_PKEY_free(key);
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
efree(sigbuf);
|
||||
if (error) {
|
||||
spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
|
||||
@@ -1981,7 +1984,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
|
||||
|
||||
sigbuf[siglen] = '\0';
|
||||
EVP_PKEY_free(key);
|
||||
EVP_MD_CTX_destroy(md_ctx);
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
#else
|
||||
size_t siglen;
|
||||
sigbuf = NULL;
|
||||
|
||||
Reference in New Issue
Block a user