From d6cd0b66241db22769a8b5323bc2be983eb73cbc Mon Sep 17 00:00:00 2001 From: Jiasheng Jiang Date: Fri, 27 Jun 2025 15:59:13 +0000 Subject: [PATCH] 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 Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27896) (cherry picked from commit 8a7545607e872ccaff3018e2cd201cce65e615ec) --- demos/cms/cms_ddec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/cms/cms_ddec.c b/demos/cms/cms_ddec.c index d119e972222..1958dcd623a 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"); -- 2.47.2