Skip to content

Commit aa1e826

Browse files
committed
Add missing error check on BN_CTX_new()
If this fails, then the big numbers will be allocated outside of the context, leading to leaks.
1 parent 3053a03 commit aa1e826

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ext/openssl/openssl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4395,6 +4395,9 @@ static bool php_openssl_pkey_init_legacy_ec(EC_KEY *eckey, zval *data, bool *is_
43954395
EC_POINT *point_q = NULL;
43964396
EC_GROUP *group = NULL;
43974397
BN_CTX *bctx = BN_CTX_new();
4398+
if (!bctx) {
4399+
goto clean_exit;
4400+
}
43984401

43994402
*is_private = false;
44004403

0 commit comments

Comments
 (0)