mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Add a pointless 2-byte memset in cell_pack
There is probably no code that can write the 2 bytes at the end of the packed_cell_t when the cell is only a 512-byte cell, but let's not get overconfident there.
This commit is contained in:
parent
bfffc1f0fc
commit
1c0e87f6d8
@ -361,6 +361,7 @@ cell_pack(packed_cell_t *dst, const cell_t *src, int wide_circ_ids)
|
|||||||
} else {
|
} else {
|
||||||
set_uint16(dest, htons(src->circ_id));
|
set_uint16(dest, htons(src->circ_id));
|
||||||
dest += 2;
|
dest += 2;
|
||||||
|
memset(dest+CELL_MAX_NETWORK_SIZE-2, 0, 2); /*make sure it's clear */
|
||||||
}
|
}
|
||||||
set_uint8(dest, src->command);
|
set_uint8(dest, src->command);
|
||||||
memcpy(dest+1, src->payload, CELL_PAYLOAD_SIZE);
|
memcpy(dest+1, src->payload, CELL_PAYLOAD_SIZE);
|
||||||
|
Loading…
Reference in New Issue
Block a user