We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c8c9ff6 + 2c08d9a commit fb5d478Copy full SHA for fb5d478
1 file changed
ext/openssl/openssl.c
@@ -1032,6 +1032,11 @@ PHP_FUNCTION(openssl_x509_parse)
1032
1033
subject_name = X509_get_subject_name(cert);
1034
cert_name = X509_NAME_oneline(subject_name, NULL, 0);
1035
+ if (cert_name == NULL) {
1036
+ php_openssl_store_errors();
1037
+ goto err;
1038
+ }
1039
+
1040
add_assoc_string(return_value, "name", cert_name);
1041
OPENSSL_free(cert_name);
1042
@@ -1064,6 +1069,12 @@ PHP_FUNCTION(openssl_x509_parse)
1064
1069
}
1065
1070
1066
1071
str_serial = i2s_ASN1_INTEGER(NULL, asn1_serial);
1072
+ /* Can return NULL on error or memory allocation failure */
1073
+ if (!str_serial) {
1074
1075
1076
1077
1067
1078
add_assoc_string(return_value, "serialNumber", str_serial);
1068
1079
OPENSSL_free(str_serial);
1080
0 commit comments