mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-27 06:32:20 +01:00
src/ssl.c: fix overflow/overrun defect in wolfSSL_writev().
This commit is contained in:
@@ -11549,15 +11549,17 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
||||
#endif
|
||||
byte* myBuffer = staticBuffer;
|
||||
int dynamic = 0;
|
||||
word32 sending = 0;
|
||||
int idx = 0;
|
||||
size_t sending = 0;
|
||||
size_t idx = 0;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_writev");
|
||||
|
||||
for (i = 0; i < iovcnt; i++)
|
||||
sending += iov[i].iov_len;
|
||||
if (! WC_SAFE_SUM_UNSIGNED(size_t, sending, iov[i].iov_len,
|
||||
sending))
|
||||
return BUFFER_E;
|
||||
|
||||
if (sending > sizeof(staticBuffer)) {
|
||||
myBuffer = (byte*)XMALLOC(sending, ssl->heap,
|
||||
|
||||
Reference in New Issue
Block a user