summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-06-27 11:04:44 -0400
committerNick Mathewson <nickm@torproject.org>2017-06-27 11:04:44 -0400
commit3483f7c00349be6cba7b703f2e5ee94563d0c6eb (patch)
treef52fd3a933a1ceb6750576779e8bb476470cc5a4 /src
parent307be8d4a7f1607b14bac6d9ed757e20a2008a16 (diff)
parent9a0fd2dbb187e898f63064c483776538a90562f1 (diff)
downloadtor-3483f7c00349be6cba7b703f2e5ee94563d0c6eb.tar.gz
tor-3483f7c00349be6cba7b703f2e5ee94563d0c6eb.zip
Merge branch 'maint-0.2.7-redux' into maint-0.2.8
Diffstat (limited to 'src')
-rw-r--r--src/or/connection_or.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 9730e1a952..3892ac02fb 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -431,9 +431,11 @@ cell_pack(packed_cell_t *dst, const cell_t *src, int wide_circ_ids)
set_uint32(dest, htonl(src->circ_id));
dest += 4;
} else {
+ /* Clear the last two bytes of dest, in case we can accidentally
+ * send them to the network somehow. */
+ memset(dest+CELL_MAX_NETWORK_SIZE-2, 0, 2);
set_uint16(dest, htons(src->circ_id));
dest += 2;
- memset(dest+CELL_MAX_NETWORK_SIZE-2, 0, 2); /*make sure it's clear */
}
set_uint8(dest, src->command);
memcpy(dest+1, src->payload, CELL_PAYLOAD_SIZE);