]> 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:33:21 +0000 (19:33 +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)

demos/cms/cms_ddec.c

index d119e9722226fa88cab8c5f1d1aea57241cb8f29..1958dcd623a5c487cfc07b0850b32bfe20109167 100644 (file)
@@ -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");