We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a0e679e + c4e70a2 commit fc55723Copy full SHA for fc55723
1 file changed
ext/openssl/openssl.c
@@ -1152,7 +1152,7 @@ PHP_FUNCTION(openssl_x509_parse)
1152
goto err_subitem;
1153
}
1154
1155
- else if (X509V3_EXT_print(bio_out, extension, 0, 0)) {
+ else if (X509V3_EXT_print(bio_out, extension, 0, 0) > 0) {
1156
BIO_get_mem_ptr(bio_out, &bio_buf);
1157
add_assoc_stringl(&subitem, extname, bio_buf->data, bio_buf->length);
1158
} else {
@@ -2326,7 +2326,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
2326
EVP_PKEY *pkey = Z_OPENSSL_PKEY_P(key)->pkey;
2327
2328
BIO *out = BIO_new(BIO_s_mem());
2329
- if (!PEM_write_bio_PUBKEY(out, pkey)) {
+ if (!out || !PEM_write_bio_PUBKEY(out, pkey)) {
2330
BIO_free(out);
2331
php_openssl_store_errors();
2332
RETURN_FALSE;
0 commit comments