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)
This commit is contained in:
Shane Lontis 2020-08-11 15:17:17 +10:00
parent 3c1ccfea85
commit 90e0e0d802

View File

@ -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++) {