Add a one-word sentinel value of 0x0 at the end of each buf_t chunk
commitb6227edae1d8318b694029800a26e17a2a960af5
authorNick Mathewson <nickm@torproject.org>
Fri, 14 Oct 2016 13:38:12 +0000 (14 09:38 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 20 Dec 2016 23:22:53 +0000 (20 18:22 -0500)
treeaf4ab167ae727f06050526bac86f6c8b5dc0393f
parent746c51b6132d84fc7899e6b95b4a1666717d8cce
Add a one-word sentinel value of 0x0 at the end of each buf_t chunk

This helps protect against bugs where any part of a buf_t's memory
is passed to a function that expects a NUL-terminated input.

It also closes TROVE-2016-10-001 (aka bug 20384).
changes/buf-sentinel [new file with mode: 0644]
src/or/buffers.c