Add a one-word sentinel value of 0x0 at the end of each buf_t chunk
commit3cea86eb2fbb65949673eb4ba8ebb695c87a57ce
authorNick Mathewson <nickm@torproject.org>
Fri, 14 Oct 2016 13:38:12 +0000 (14 09:38 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 17 Oct 2016 18:49:54 +0000 (17 14:49 -0400)
treeef0bd43d76691b249912bc22dff34dfe771831dd
parent12a72983766d5265b5259038af711cb172671af7
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