diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-08-09 10:50:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-08-09 10:50:11 -0400 |
commit | 91b52a259a271df7ceeea6d8bf7adbd4d7e15a6c (patch) | |
tree | b22c8d0f16d23fd0d438917fc177413a1197ab8a /src | |
parent | 93be3a8822ae791cc8adb78ea7d7e76e4c10db41 (diff) | |
parent | 393944dfb67fb27991e152ec67f74cebbf3a23ba (diff) | |
download | tor-91b52a259a271df7ceeea6d8bf7adbd4d7e15a6c.tar.gz tor-91b52a259a271df7ceeea6d8bf7adbd4d7e15a6c.zip |
Merge remote-tracking branch 'public/bug6252_again' into maint-0.2.3
Diffstat (limited to 'src')
-rw-r--r-- | src/or/relay.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 3e418ea13f..3d261c2650 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1265,11 +1265,25 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, case RELAY_COMMAND_SENDME: if (!rh.stream_id) { if (layer_hint) { + if (layer_hint->package_window + CIRCWINDOW_INCREMENT > + CIRCWINDOW_START_MAX) { + log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, + "Bug/attack: unexpected sendme cell from exit relay. " + "Closing circ."); + return -END_CIRC_REASON_TORPROTOCOL; + } layer_hint->package_window += CIRCWINDOW_INCREMENT; log_debug(LD_APP,"circ-level sendme at origin, packagewindow %d.", layer_hint->package_window); circuit_resume_edge_reading(circ, layer_hint); } else { + if (circ->package_window + CIRCWINDOW_INCREMENT > + CIRCWINDOW_START_MAX) { + log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, + "Bug/attack: unexpected sendme cell from client. " + "Closing circ."); + return -END_CIRC_REASON_TORPROTOCOL; + } circ->package_window += CIRCWINDOW_INCREMENT; log_debug(LD_APP, "circ-level sendme at non-origin, packagewindow %d.", |