Skip to content

Commit 5684949

Browse files
committed
Fix error check on X509V3_EXT_print()
The docs I found of this function appear to be wrong, as it can also return -1 on failure. See also openssl/openssl#29793 Closes phpGH-21047.
1 parent 4a16d22 commit 5684949

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/openssl/openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,7 @@ PHP_FUNCTION(openssl_x509_parse)
22522252
goto err_subitem;
22532253
}
22542254
}
2255-
else if (X509V3_EXT_print(bio_out, extension, 0, 0)) {
2255+
else if (X509V3_EXT_print(bio_out, extension, 0, 0) > 0) {
22562256
BIO_get_mem_ptr(bio_out, &bio_buf);
22572257
add_assoc_stringl(&subitem, extname, bio_buf->data, bio_buf->length);
22582258
} else {

0 commit comments

Comments
 (0)