Skip to content

Commit 9b5749a

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix potential NULL pointer dereference before calling EVP_SignInit
2 parents 13c8d93 + 07fe3b2 commit 9b5749a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/phar/util.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,13 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat
18901890
}
18911891

18921892
md_ctx = EVP_MD_CTX_create();
1893+
if (md_ctx == NULL) {
1894+
EVP_PKEY_free(key);
1895+
if (error) {
1896+
spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname);
1897+
}
1898+
return FAILURE;
1899+
}
18931900

18941901
siglen = EVP_PKEY_size(key);
18951902
sigbuf = emalloc(siglen + 1);

0 commit comments

Comments
 (0)