From 16ffebe50a5acac7636fbc71d70775291cc3930c Mon Sep 17 00:00:00 2001 From: doug <> Date: Mon, 20 Jul 2015 16:48:11 +0000 Subject: Remove condition that never happens and fix error handling. There were two issues here: 1) in == NULL is never true because it's checked above here. (Fixes Coverity 21705) 2) All error handling is in the if (in == NULL) guard, so effectively there's no error handling and it continues on. ok miod@ jsing@ --- src/usr.bin/openssl/pkcs7.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/usr.bin/openssl/pkcs7.c') diff --git a/src/usr.bin/openssl/pkcs7.c b/src/usr.bin/openssl/pkcs7.c index 70b58d8b84..77a20da154 100644 --- a/src/usr.bin/openssl/pkcs7.c +++ b/src/usr.bin/openssl/pkcs7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs7.c,v 1.2 2014/08/28 14:23:52 jsing Exp $ */ +/* $OpenBSD: pkcs7.c,v 1.3 2015/07/20 16:48:11 doug Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -173,11 +173,10 @@ bad: if (infile == NULL) BIO_set_fp(in, stdin, BIO_NOCLOSE); else { - if (BIO_read_filename(in, infile) <= 0) - if (in == NULL) { - perror(infile); - goto end; - } + if (BIO_read_filename(in, infile) <= 0) { + perror(infile); + goto end; + } } if (informat == FORMAT_ASN1) -- cgit v1.2.3-55-g6feb