Skip to content

Commit 2c8de71

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix memory leaks and missing error propagation when php_openssl_csr_make() fails to set a version
2 parents a28d33f + 79b1ca2 commit 2c8de71

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ PHP NEWS
2121

2222
- OpenSSL:
2323
. Fix memory leak regression in openssl_pbkdf2(). (ndossche)
24+
. Fix a bunch of memory leaks and crashes on edge cases. (ndossche)
2425

2526
- DOM:
2627
. Fixed bug GH-21566 (Dom\XMLDocument::C14N() emits duplicate xmlns

ext/openssl/openssl_backend_common.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,13 +1090,15 @@ zend_result php_openssl_csr_make(struct php_x509_request * req, X509_REQ * csr,
10901090
}
10911091
}
10921092
}
1093+
1094+
if (!X509_REQ_set_pubkey(csr, req->priv_key)) {
1095+
php_openssl_store_errors();
1096+
}
10931097
} else {
10941098
php_openssl_store_errors();
1099+
return FAILURE;
10951100
}
10961101

1097-
if (!X509_REQ_set_pubkey(csr, req->priv_key)) {
1098-
php_openssl_store_errors();
1099-
}
11001102
return SUCCESS;
11011103
}
11021104

0 commit comments

Comments
 (0)