File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ PHP NEWS
3232
3333- OpenSSL:
3434 . Fix memory leaks when sk_X509_new_null() fails. (ndossche)
35+ . Fix crash when in openssl_x509_parse() when i2s_ASN1_INTEGER() fails.
36+ (ndossche)
3537
3638- Phar:
3739 . Fixed bug GH-20882 (buildFromIterator breaks with missing base directory).
Original file line number Diff line number Diff line change @@ -2166,6 +2166,12 @@ PHP_FUNCTION(openssl_x509_parse)
21662166 }
21672167
21682168 str_serial = i2s_ASN1_INTEGER (NULL , asn1_serial );
2169+ /* Can return NULL on error or memory allocation failure */
2170+ if (!str_serial ) {
2171+ php_openssl_store_errors ();
2172+ goto err ;
2173+ }
2174+
21692175 add_assoc_string (return_value , "serialNumber" , str_serial );
21702176 OPENSSL_free (str_serial );
21712177
You can’t perform that action at this time.
0 commit comments