summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/asn_mime.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2018-08-05 16:50:41 +0200
committerAndy Polyakov <appro@openssl.org>2018-08-07 08:56:54 +0200
commit5b37fef04a2b765835361f0652aaa0c41ed1b842 (patch)
tree47677e73f897a8b5921437c53c93070e61dec321 /crypto/asn1/asn_mime.c
parentx509/x509name.c: fix potential crash in X509_NAME_get_text_by_OBJ. (diff)
downloadopenssl-5b37fef04a2b765835361f0652aaa0c41ed1b842.tar.xz
openssl-5b37fef04a2b765835361f0652aaa0c41ed1b842.zip
Harmonize use of sk_TYPE_find's return value.
In some cases it's about redundant check for return value, in some cases it's about replacing check for -1 with comparison to 0. Otherwise compiler might generate redundant check for <-1. [Even formatting and readability fixes.] Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6860)
Diffstat (limited to 'crypto/asn1/asn_mime.c')
-rw-r--r--crypto/asn1/asn_mime.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index aa92a8e115..dfd5be6347 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -883,8 +883,6 @@ static MIME_HEADER *mime_hdr_find(STACK_OF(MIME_HEADER) *hdrs, const char *name)
htmp.params = NULL;
idx = sk_MIME_HEADER_find(hdrs, &htmp);
- if (idx < 0)
- return NULL;
return sk_MIME_HEADER_value(hdrs, idx);
}
@@ -896,8 +894,6 @@ static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, const char *name)
param.param_name = (char *)name;
param.param_value = NULL;
idx = sk_MIME_PARAM_find(hdr->params, &param);
- if (idx < 0)
- return NULL;
return sk_MIME_PARAM_value(hdr->params, idx);
}