We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4d544e4 + e474d3c commit c4e70a2Copy full SHA for c4e70a2
1 file changed
ext/openssl/openssl.c
@@ -1148,7 +1148,7 @@ PHP_FUNCTION(openssl_x509_parse)
1148
goto err_subitem;
1149
}
1150
1151
- else if (X509V3_EXT_print(bio_out, extension, 0, 0)) {
+ else if (X509V3_EXT_print(bio_out, extension, 0, 0) > 0) {
1152
BIO_get_mem_ptr(bio_out, &bio_buf);
1153
add_assoc_stringl(&subitem, extname, bio_buf->data, bio_buf->length);
1154
} else {
@@ -2308,7 +2308,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
2308
EVP_PKEY *pkey = Z_OPENSSL_PKEY_P(key)->pkey;
2309
2310
BIO *out = BIO_new(BIO_s_mem());
2311
- if (!PEM_write_bio_PUBKEY(out, pkey)) {
+ if (!out || !PEM_write_bio_PUBKEY(out, pkey)) {
2312
BIO_free(out);
2313
php_openssl_store_errors();
2314
RETURN_FALSE;
0 commit comments