From: Tomas Mraz Date: Wed, 4 Aug 2021 12:51:49 +0000 (+0200) Subject: cms: Do not try to check binary format on stdin X-Git-Tag: openssl-3.0.0~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5c0f696193fa28741dfc08ab6b024cd07e38e5e;p=thirdparty%2Fopenssl.git cms: Do not try to check binary format on stdin Fixes #16195 Reviewed-by: Paul Dale Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/16216) --- diff --git a/apps/cms.c b/apps/cms.c index 58ce54e4543..714cf3e4ff5 100644 --- a/apps/cms.c +++ b/apps/cms.c @@ -278,6 +278,8 @@ static void warn_binary(const char *file) unsigned char linebuf[1024], *cur, *end; int len; + if (file == NULL) + return; /* cannot give a warning for stdin input */ if ((bio = bio_open_default(file, 'r', FORMAT_BINARY)) == NULL) return; /* cannot give a proper warning since there is an error */ while ((len = BIO_read(bio, linebuf, sizeof(linebuf))) > 0) {