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 | 0576f9f433f20af756bdaba6df5ac270d147e007 (patch) | |
tree | c997010a05239e8fcb7f92de7bdfbae1ed8deeb0 /src/or | |
parent | 22f441d4ee40a6d1c9615aeb2b08b872549abfd0 (diff) | |
parent | 32eba3d6aa7bd39048d32a566d119c013e526759 (diff) | |
download | tor-0576f9f433f20af756bdaba6df5ac270d147e007.tar.gz tor-0576f9f433f20af756bdaba6df5ac270d147e007.zip |
Merge branch 'maint-0.3.1'
Diffstat (limited to 'src/or')
-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 ab0f411cc5..753148291c 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -420,9 +420,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); |