diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-08-11 15:17:17 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-08-24 11:19:28 +1000 |
commit | 90e0e0d8023fca71b019232ffc5804b8d07e2ff2 (patch) | |
tree | 00703537a5b9641f4467c6a16058347edb180ee6 /crypto/encode_decode/decoder_pkey.c | |
parent | 3c1ccfea85e6dcb93aba5cfb166d7aa88bd0a587 (diff) |
Fix coverity CID #1465797 - Negative loop bound in collect_deserializer
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12628)
Diffstat (limited to 'crypto/encode_decode/decoder_pkey.c')
-rw-r--r-- | crypto/encode_decode/decoder_pkey.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index 7f468c2476..e04b94de86 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -289,6 +289,8 @@ static void collect_decoder(OSSL_DECODER *decoder, void *arg) return; data->error_occured = 1; /* Assume the worst */ + if (data->names == NULL) + return; end_i = sk_OPENSSL_CSTRING_num(data->names); for (i = 0; i < end_i; i++) { |