mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Add fix for remote-crash bug.
svn:r2447
This commit is contained in:
parent
578a3e25e5
commit
f6fc2b9dd2
@ -381,6 +381,10 @@ int fetch_from_buf_http(buf_t *buf,
|
||||
p = strstr(headers, CONTENT_LENGTH);
|
||||
if (p) {
|
||||
contentlen = atoi(p+strlen(CONTENT_LENGTH));
|
||||
if (contentlen < 0) {
|
||||
log_fn(LOG_WARN, "Content-Length is less than zero; it looks like someone is trying to crash us.");
|
||||
return -1;
|
||||
}
|
||||
/* if content-length is malformed, then our body length is 0. fine. */
|
||||
log_fn(LOG_DEBUG,"Got a contentlen of %d.",contentlen);
|
||||
if(bodylen < contentlen) {
|
||||
|
Loading…
Reference in New Issue
Block a user