We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 014f55f commit 204eb96Copy full SHA for 204eb96
1 file changed
src/ssl.c
@@ -11549,15 +11549,17 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
11549
#endif
11550
byte* myBuffer = staticBuffer;
11551
int dynamic = 0;
11552
- word32 sending = 0;
11553
- int idx = 0;
+ size_t sending = 0;
+ size_t idx = 0;
11554
int i;
11555
int ret;
11556
11557
WOLFSSL_ENTER("wolfSSL_writev");
11558
11559
for (i = 0; i < iovcnt; i++)
11560
- sending += iov[i].iov_len;
+ if (! WC_SAFE_SUM_UNSIGNED(size_t, sending, iov[i].iov_len,
11561
+ sending))
11562
+ return BUFFER_E;
11563
11564
if (sending > sizeof(staticBuffer)) {
11565
myBuffer = (byte*)XMALLOC(sending, ssl->heap,
0 commit comments