Skip to content

Commit 460d2f3

Browse files
committed
Add missing error check on PEM_write_bio_CMS()
On failure, this function returns 0. 2 other callers of this function already check the return value, but this one was missed.
1 parent 729f006 commit 460d2f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/openssl/openssl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5989,7 +5989,11 @@ PHP_FUNCTION(openssl_cms_verify)
59895989
}
59905990

59915991
if (p7bout) {
5992-
PEM_write_bio_CMS(p7bout, cms);
5992+
if (PEM_write_bio_CMS(p7bout, cms) == 0) {
5993+
php_error_docref(NULL, E_WARNING, "Failed to write CMS to BIO");
5994+
php_openssl_store_errors();
5995+
RETVAL_FALSE;
5996+
}
59935997
}
59945998
}
59955999
} else {

0 commit comments

Comments
 (0)