mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Removed dead code in linebuffer_ctrl()
Fixes Coverity CID 1476284 Also add possible number truncation check. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14928)
This commit is contained in:
parent
6b2978406d
commit
59088414bc
@ -232,12 +232,12 @@ static long linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
}
|
||||
break;
|
||||
case BIO_C_SET_BUFF_SIZE:
|
||||
if (num > INT_MAX)
|
||||
return 0;
|
||||
obs = (int)num;
|
||||
p = ctx->obuf;
|
||||
if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) {
|
||||
if (num <= 0)
|
||||
return 0;
|
||||
p = OPENSSL_malloc((size_t)num);
|
||||
p = OPENSSL_malloc((size_t)obs);
|
||||
if (p == NULL)
|
||||
goto malloc_error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user