diff options
author | Andy Polyakov <appro@openssl.org> | 2018-08-05 16:50:41 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2018-08-07 08:56:54 +0200 |
commit | 5b37fef04a2b765835361f0652aaa0c41ed1b842 (patch) | |
tree | 47677e73f897a8b5921437c53c93070e61dec321 /crypto/objects | |
parent | x509/x509name.c: fix potential crash in X509_NAME_get_text_by_OBJ. (diff) | |
download | openssl-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/objects')
-rw-r--r-- | crypto/objects/obj_xref.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/objects/obj_xref.c b/crypto/objects/obj_xref.c index 42d204ca4c..faf59eb20c 100644 --- a/crypto/objects/obj_xref.c +++ b/crypto/objects/obj_xref.c @@ -46,10 +46,9 @@ int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid) const nid_triple *rv = NULL; tmp.sign_id = signid; - if (sig_app) { + if (sig_app != NULL) { int idx = sk_nid_triple_find(sig_app, &tmp); - if (idx >= 0) - rv = sk_nid_triple_value(sig_app, idx); + rv = sk_nid_triple_value(sig_app, idx); } #ifndef OBJ_XREF_TEST2 if (rv == NULL) { |