diff options
author | Pauli <pauli@openssl.org> | 2022-03-24 04:31:19 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-03-26 04:31:21 +0100 |
commit | 0bcae9893b99666158dd8b35fb674e6188b0b5c3 (patch) | |
tree | 0a9d93b696552dafcddabf7f31b820d7e9e7a237 /crypto/encode_decode | |
parent | ticket_lifetime_hint may exceed 1 week in TLSv1.3 (diff) | |
download | openssl-0bcae9893b99666158dd8b35fb674e6188b0b5c3.tar.xz openssl-0bcae9893b99666158dd8b35fb674e6188b0b5c3.zip |
Fix Coverity 1503218: negative loop bound
OPENSSL_sk_num returns an integer which can theoretically be negative.
Assigning this to a size_t and using it as a loop bound isn't ideal.
Rather than adding checked for NULL or negative returns, changing the loop
index and end to int is simpler.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17954)
Diffstat (limited to 'crypto/encode_decode')
-rw-r--r-- | crypto/encode_decode/decoder_pkey.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index 873b514d3c..8cb320a5ce 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -260,7 +260,7 @@ static void collect_decoder(OSSL_DECODER *decoder, void *arg) { struct collect_data_st *data = arg; STACK_OF(EVP_KEYMGMT) *keymgmts = data->keymgmts; - size_t i, end_i; + int i, end_i; EVP_KEYMGMT *keymgmt; const OSSL_PROVIDER *prov; void *provctx; |