commit 4c810a6abe8817be07390d1bcbd8f25ef4ad826a Merge: 155e0dee49 b4400e2093 Author: Nick Mathewson nickm@torproject.org Date: Thu Jul 30 14:35:06 2020 -0400
Merge branch 'bug40076_044'
changes/bug40076 | 5 ++++ src/lib/buf/buffers.c | 2 ++ src/test/test_buffers.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+)
diff --cc src/lib/buf/buffers.c index aa0af69072,a5031a47a6..23fc1e23a6 --- a/src/lib/buf/buffers.c +++ b/src/lib/buf/buffers.c @@@ -692,13 -691,13 +692,15 @@@ buf_move_all(buf_t *buf_out, buf_t *buf { tor_assert(buf_out); if (!buf_in) - return; + return 0; + if (buf_datalen(buf_in) == 0) - return; ++ return 0; if (BUG(buf_out->datalen > BUF_MAX_LEN || buf_in->datalen > BUF_MAX_LEN)) - return; + return 0; if (BUG(buf_out->datalen > BUF_MAX_LEN - buf_in->datalen)) - return; + return 0; + + size_t n_bytes_moved = buf_in->datalen;
if (buf_out->head == NULL) { buf_out->head = buf_in->head;