File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1032,6 +1032,11 @@ PHP_FUNCTION(openssl_x509_parse)
10321032
10331033 subject_name = X509_get_subject_name (cert );
10341034 cert_name = X509_NAME_oneline (subject_name , NULL , 0 );
1035+ if (cert_name == NULL ) {
1036+ php_openssl_store_errors ();
1037+ goto err ;
1038+ }
1039+
10351040 add_assoc_string (return_value , "name" , cert_name );
10361041 OPENSSL_free (cert_name );
10371042
@@ -1064,6 +1069,12 @@ PHP_FUNCTION(openssl_x509_parse)
10641069 }
10651070
10661071 str_serial = i2s_ASN1_INTEGER (NULL , asn1_serial );
1072+ /* Can return NULL on error or memory allocation failure */
1073+ if (!str_serial ) {
1074+ php_openssl_store_errors ();
1075+ goto err ;
1076+ }
1077+
10671078 add_assoc_string (return_value , "serialNumber" , str_serial );
10681079 OPENSSL_free (str_serial );
10691080
You can’t perform that action at this time.
0 commit comments