mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
buf: add BUF_MAX_LEN
This commit is contained in:
@@ -3804,8 +3804,8 @@ connection_buf_read_from_socket(connection_t *conn, ssize_t *max_to_read,
|
||||
at_most = connection_bucket_read_limit(conn, approx_time());
|
||||
}
|
||||
|
||||
/* Do not allow inbuf to grow past INT_MAX - 1. */
|
||||
const ssize_t maximum = INT_MAX - 1 - buf_datalen(conn->inbuf);
|
||||
/* Do not allow inbuf to grow past BUF_MAX_LEN. */
|
||||
const ssize_t maximum = BUF_MAX_LEN - buf_datalen(conn->inbuf);
|
||||
if (at_most > maximum) {
|
||||
at_most = maximum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user