Modify "Protect buffers against INT_MAX datalen overflows." for 0.2.9

This commit is contained in:
Nick Mathewson 2019-04-09 13:14:28 -04:00 committed by teor
parent c10011532e
commit 37bd7fa50d
No known key found for this signature in database
GPG Key ID: 10FEAA0E7075672A

View File

@ -394,10 +394,6 @@ buf_free(buf_t *buf)
{
if (!buf)
return;
if (BUG(buf_out->datalen >= INT_MAX || buf_in->datalen >= INT_MAX))
return;
if (BUG(buf_out->datalen >= INT_MAX - buf_in->datalen))
return;
buf_clear(buf);
buf->magic = 0xdeadbeef;
@ -2067,4 +2063,3 @@ assert_buf_ok(buf_t *buf)
tor_assert(buf->datalen == total);
}
}