mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Modify "Protect buffers against INT_MAX datalen overflows." for 0.2.9
This commit is contained in:
parent
c10011532e
commit
37bd7fa50d
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user