Skip to content

Commit 4bc5de3

Browse files
committed
Fix error check on X509_set_subject_name()
This call can fail but this is not checked. The other setter call is checked however.
1 parent 3053a03 commit 4bc5de3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/openssl/openssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3367,7 +3367,10 @@ PHP_FUNCTION(openssl_csr_sign)
33673367
PHP_OPENSSL_ASN1_INTEGER_set(X509_get_serialNumber(new_cert), serial);
33683368
}
33693369

3370-
X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr));
3370+
if (!X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr))) {
3371+
php_openssl_store_errors();
3372+
goto cleanup;
3373+
}
33713374

33723375
if (cert == NULL) {
33733376
cert = new_cert;

0 commit comments

Comments
 (0)