diff options
author | doug <> | 2015-07-20 16:48:11 +0000 |
---|---|---|
committer | doug <> | 2015-07-20 16:48:11 +0000 |
commit | 16ffebe50a5acac7636fbc71d70775291cc3930c (patch) | |
tree | 475ecaf39f5ad7b889d80327691a359c8f02eee5 | |
parent | e9c572c56a6b9de69b6b334e56df19d11d0304ef (diff) | |
download | openbsd-16ffebe50a5acac7636fbc71d70775291cc3930c.tar.gz openbsd-16ffebe50a5acac7636fbc71d70775291cc3930c.tar.bz2 openbsd-16ffebe50a5acac7636fbc71d70775291cc3930c.zip |
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@
-rw-r--r-- | src/usr.bin/openssl/pkcs7.c | 11 |
1 files changed, 5 insertions, 6 deletions
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 @@ | |||
1 | /* $OpenBSD: pkcs7.c,v 1.2 2014/08/28 14:23:52 jsing Exp $ */ | 1 | /* $OpenBSD: pkcs7.c,v 1.3 2015/07/20 16:48:11 doug Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -173,11 +173,10 @@ bad: | |||
173 | if (infile == NULL) | 173 | if (infile == NULL) |
174 | BIO_set_fp(in, stdin, BIO_NOCLOSE); | 174 | BIO_set_fp(in, stdin, BIO_NOCLOSE); |
175 | else { | 175 | else { |
176 | if (BIO_read_filename(in, infile) <= 0) | 176 | if (BIO_read_filename(in, infile) <= 0) { |
177 | if (in == NULL) { | 177 | perror(infile); |
178 | perror(infile); | 178 | goto end; |
179 | goto end; | 179 | } |
180 | } | ||
181 | } | 180 | } |
182 | 181 | ||
183 | if (informat == FORMAT_ASN1) | 182 | if (informat == FORMAT_ASN1) |