diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2021-04-12 13:58:14 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2021-04-16 12:10:08 +1000 |
commit | 42e7d2f10e3658c0c248df8a6edf3c48c477e4b0 (patch) | |
tree | 1122340c23e67327e2673fd516c5be2dc666e228 /crypto/asn1/p5_pbe.c | |
parent | 34ed73339602c361d09fe4233d65cef996356239 (diff) | |
download | openssl-new-42e7d2f10e3658c0c248df8a6edf3c48c477e4b0.tar.gz |
Add more negative checks for integers passed to OPENSSL_malloc().
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14830)
Diffstat (limited to 'crypto/asn1/p5_pbe.c')
-rw-r--r-- | crypto/asn1/p5_pbe.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/asn1/p5_pbe.c b/crypto/asn1/p5_pbe.c index b6388cd12f..fb43044822 100644 --- a/crypto/asn1/p5_pbe.c +++ b/crypto/asn1/p5_pbe.c @@ -44,6 +44,8 @@ int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, } if (!saltlen) saltlen = PKCS5_SALT_LEN; + if (saltlen < 0) + goto err; sstr = OPENSSL_malloc(saltlen); if (sstr == NULL) { |