]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
demos/cms/cms_ddec.c: Replace "in" with "dcont" to correctly check the success of...
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Fri, 27 Jun 2025 15:59:13 +0000 (15:59 +0000)
committerTomas Mraz <tomas@openssl.org>
Tue, 1 Jul 2025 17:34:06 +0000 (19:34 +0200)
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)

(cherry picked from commit 8a7545607e872ccaff3018e2cd201cce65e615ec)

demos/cms/cms_ddec.c

index cb6c2694c69790aca051b04a95be0156f6fcaffc..bacc38e13bf48d7da6aa8accd542dcd7b55a1995 100644 (file)
@@ -57,7 +57,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");