Skip to content

Commit 51ea4a6

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 d2ef156 commit 51ea4a6

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
@@ -5991,7 +5991,11 @@ PHP_FUNCTION(openssl_cms_verify)
59915991
}
59925992

59935993
if (p7bout) {
5994-
PEM_write_bio_CMS(p7bout, cms);
5994+
if (PEM_write_bio_CMS(p7bout, cms) == 0) {
5995+
php_error_docref(NULL, E_WARNING, "Failed to write CMS to file");
5996+
php_openssl_store_errors();
5997+
RETVAL_FALSE;
5998+
}
59955999
}
59966000
}
59976001
} else {

0 commit comments

Comments
 (0)