diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-02-04 13:50:51 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-02-04 13:50:51 +1000 |
commit | d5e66eab0bc08d701ba8386d3a36d417d19966aa (patch) | |
tree | ef8de7ba3180d40dcdf4f0f73df80e25c42f57d4 /apps/pkcs12.c | |
parent | 450d12c825cc9016e5e8990423fa7ffdb843a1f0 (diff) | |
download | openssl-new-d5e66eab0bc08d701ba8386d3a36d417d19966aa.tar.gz |
Fix coverity issues CID 1457745...1457752, 1457853, 1457854
CID 1457854 - keymgmt_lib.c : OVERRUN
CID 1457853 - self_test_kats.c : UNINT
CID 1457752 - fipsprov.c RESOURCE_LEAK (code change in another PR removed this)
CID 1457751 - apps/pkcs12.c CHECKED_RETURN
CID 1457750 - dsa_ossl.c RESOURCE_LEAK (marked as false positive since tmp can not be NULL)
CID 1457749 - apps/nseq.c : CHECKED_RETURN
CID 1457748 - cipher_aes_cbc_hmac_sha.c : SIZEOF_MISMATCH
CID 1457747 - cipher_aes_cbc_hmac_sha.c : SIZEOF_MISMATCH
CID 1457746 - same as 1457752
CID 1457745 - apps/ocsp : CHECKED_RETURN
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10934)
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r-- | apps/pkcs12.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 5eff88b644..091318b67d 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -893,12 +893,13 @@ static int alg_print(const X509_ALGOR *alg) int cert_load(BIO *in, STACK_OF(X509) *sk) { - int ret; + int ret = 0; X509 *cert; - ret = 0; + while ((cert = PEM_read_bio_X509(in, NULL, NULL, NULL))) { ret = 1; - sk_X509_push(sk, cert); + if (!sk_X509_push(sk, cert)) + return 0; } if (ret) ERR_clear_error(); |