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/bio/bss_log.c | |
parent | 34ed73339602c361d09fe4233d65cef996356239 (diff) |
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/bio/bss_log.c')
-rw-r--r-- | crypto/bio/bss_log.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index 1669948f27..23ba8aeb73 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -196,6 +196,8 @@ static int slg_write(BIO *b, const char *in, int inl) /* The default */ }; + if (inl < 0) + return 0; if ((buf = OPENSSL_malloc(inl + 1)) == NULL) { ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE); return 0; |