diff options
author | Pauli <pauli@openssl.org> | 2022-10-14 03:53:02 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-10-14 03:53:02 +0200 |
commit | 9ab57f29c78d8d69b6ba9c579521594d7170ca44 (patch) | |
tree | 3e32773e6cee175601c5b88bb69b5cecc5ae1234 /crypto/encode_decode | |
parent | Fix LLVM vs Apple LLVM version numbering confusion, for $avx512ifma (diff) | |
download | openssl-9ab57f29c78d8d69b6ba9c579521594d7170ca44.tar.xz openssl-9ab57f29c78d8d69b6ba9c579521594d7170ca44.zip |
Coverity 1515953: negative loop bound
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19413)
Diffstat (limited to 'crypto/encode_decode')
-rw-r--r-- | crypto/encode_decode/encoder_pkey.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/encode_decode/encoder_pkey.c b/crypto/encode_decode/encoder_pkey.c index 1a09b01f49..6954343422 100644 --- a/crypto/encode_decode/encoder_pkey.c +++ b/crypto/encode_decode/encoder_pkey.c @@ -103,14 +103,15 @@ static void collect_encoder(OSSL_ENCODER *encoder, void *arg) */ if ((data->keymgmt_prov == prov) == data->flag_find_same_provider) { void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov); - size_t i, end_i = sk_OPENSSL_CSTRING_num(data->names); + int i, end_i = sk_OPENSSL_CSTRING_num(data->names); int match; for (i = 0; i < end_i; i++) { if (data->flag_find_same_provider) match = (data->id_names[i] == encoder->base.id); else - match = OSSL_ENCODER_is_a(encoder, sk_OPENSSL_CSTRING_value(data->names, i)); + match = OSSL_ENCODER_is_a(encoder, + sk_OPENSSL_CSTRING_value(data->names, i)); if (!match || (encoder->does_selection != NULL && !encoder->does_selection(provctx, data->ctx->selection)) |