From: Vinz2008 Date: Thu, 10 Nov 2022 17:36:44 +0000 (+0100) Subject: apps/speed.c: add verifying if fdopen returns NULL X-Git-Tag: openssl-3.2.0-alpha1~1733 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9a542e41837ea65671dcd75c448d7113d34a4fd;p=thirdparty%2Fopenssl.git apps/speed.c: add verifying if fdopen returns NULL Reviewed-by: Todd Short Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19651) --- diff --git a/apps/speed.c b/apps/speed.c index 3fb98c16011..2b71cc733a0 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -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)