Skip to content

Commit 8b031ea

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. Closes phpGH-21028.
1 parent 8c11370 commit 8b031ea

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ext/openssl/openssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3376,7 +3376,10 @@ PHP_FUNCTION(openssl_csr_sign)
33763376
PHP_OPENSSL_ASN1_INTEGER_set(X509_get_serialNumber(new_cert), serial);
33773377
}
33783378

3379-
X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr));
3379+
if (!X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr))) {
3380+
php_openssl_store_errors();
3381+
goto cleanup;
3382+
}
33803383

33813384
if (cert == NULL) {
33823385
cert = new_cert;

0 commit comments

Comments
 (0)