summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinz2008 <vincentbidarddelanoe@gmail.com>2022-11-10 18:36:44 +0100
committerTomas Mraz <tomas@openssl.org>2022-11-14 12:24:42 +0100
commit1aef13c0bdb907ac55fbcc9ba69abc86e1921324 (patch)
tree0ab419d95f5f09ed7e2cbfdac8e6423955211e3e
parent511d8c0fb0eaaba4118362ac791f0ed09f89385e (diff)
apps/speed.c: add verifying if fdopen returns NULL
Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19651) (cherry picked from commit c9a542e41837ea65671dcd75c448d7113d34a4fd)
-rw-r--r--apps/speed.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/speed.c b/apps/speed.c
index d180a41f36..d1a0ddf6e9 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -3456,7 +3456,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)