diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-06-27 11:04:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-06-27 11:04:44 -0400 |
commit | 9a0fd2dbb187e898f63064c483776538a90562f1 (patch) | |
tree | 1c725b1adf5967b300e60859c693a9cf4623b056 /src/or/connection_or.c | |
parent | 24ee8595bf3aa8648d37c2f94277c33bfbc8db64 (diff) | |
parent | 3de27618e65affe3688a5d92bce96e1e4ed5a82a (diff) | |
download | tor-9a0fd2dbb187e898f63064c483776538a90562f1.tar.gz tor-9a0fd2dbb187e898f63064c483776538a90562f1.zip |
Merge branch 'maint-0.2.6' into maint-0.2.7-redux
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index a967c93aca..a45d23aac6 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -430,9 +430,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); |