]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps/speed.c: add verifying if fdopen returns NULL
authorVinz2008 <vincentbidarddelanoe@gmail.com>
Thu, 10 Nov 2022 17:36:44 +0000 (18:36 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 14 Nov 2022 11:23:16 +0000 (12:23 +0100)
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19651)

apps/speed.c

index 3fb98c1601177ec0dfd9faae035b6744f3eb8724..2b71cc733a00243b56a3ba2c3a7e9f01c23b93da 100644 (file)
@@ -3508,7 +3508,11 @@ static int do_multi(int multi, int size_num)
         char buf[1024];
         char *p;
 
-        f = fdopen(fds[n], "r");
+        if ((f = fdopen(fds[n], "r")) == NULL) {
+            BIO_printf(bio_err, "fdopen failure with 0x%x\n",
+                       errno);
+            return 1;
+        }
         while (fgets(buf, sizeof(buf), f)) {
             p = strchr(buf, '\n');
             if (p)