Commit 8a7545607e for openssl.org
commit 8a7545607e872ccaff3018e2cd201cce65e615ec
Author: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Date: Fri Jun 27 15:59:13 2025 +0000
demos/cms/cms_ddec.c: Replace "in" with "dcont" to correctly check the success of BIO_new_file()
Replace "in" with "dcont" to properly check the return value of BIO_new_file().
Fixes: 1728756 ("Detached encrypt/decrypt example, fix decrypt sample.")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27896)
diff --git a/demos/cms/cms_ddec.c b/demos/cms/cms_ddec.c
index d119e97222..1958dcd623 100644
--- a/demos/cms/cms_ddec.c
+++ b/demos/cms/cms_ddec.c
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
/* Open file containing detached content */
dcont = BIO_new_file("smencr.out", "rb");
- if (!in)
+ if (dcont == NULL)
goto err;
out = BIO_new_file("encrout.txt", "w");