We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e87107 commit 7d5c9f2Copy full SHA for 7d5c9f2
1 file changed
ext/openssl/openssl.c
@@ -2517,9 +2517,20 @@ PHP_FUNCTION(openssl_x509_read)
2517
RETURN_FALSE;
2518
}
2519
2520
+ X509 *obj_x509;
2521
+ if (cert_obj) {
2522
+ obj_x509 = X509_dup(cert);
2523
+ if (!obj_x509) {
2524
+ php_error_docref(NULL, E_WARNING, "X.509 Certificate could not be duplicated");
2525
+ RETURN_FALSE;
2526
+ }
2527
+ } else {
2528
+ obj_x509 = cert;
2529
2530
+
2531
object_init_ex(return_value, php_openssl_certificate_ce);
2532
x509_cert_obj = Z_OPENSSL_CERTIFICATE_P(return_value);
- x509_cert_obj->x509 = cert_obj ? X509_dup(cert) : cert;
2533
+ x509_cert_obj->x509 = obj_x509;
2534
2535
/* }}} */
2536
0 commit comments