summaryrefslogtreecommitdiff
path: root/src/lib/buf
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-07-30 14:35:06 -0400
committerNick Mathewson <nickm@torproject.org>2020-07-30 14:35:06 -0400
commit4c810a6abe8817be07390d1bcbd8f25ef4ad826a (patch)
tree6fdf958e97880d0def6c4c56be673152879c8d1b /src/lib/buf
parent155e0dee49ad041707b8bc498d8fb6a82103800b (diff)
parentb4400e2093f68e349464eacd7dbe44cebf8d5c71 (diff)
downloadtor-4c810a6abe8817be07390d1bcbd8f25ef4ad826a.tar.gz
tor-4c810a6abe8817be07390d1bcbd8f25ef4ad826a.zip
Merge branch 'bug40076_044'
Diffstat (limited to 'src/lib/buf')
-rw-r--r--src/lib/buf/buffers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/buf/buffers.c b/src/lib/buf/buffers.c
index aa0af69072..23fc1e23a6 100644
--- a/src/lib/buf/buffers.c
+++ b/src/lib/buf/buffers.c
@@ -693,6 +693,8 @@ buf_move_all(buf_t *buf_out, buf_t *buf_in)
tor_assert(buf_out);
if (!buf_in)
return 0;
+ if (buf_datalen(buf_in) == 0)
+ return 0;
if (BUG(buf_out->datalen > BUF_MAX_LEN || buf_in->datalen > BUF_MAX_LEN))
return 0;
if (BUG(buf_out->datalen > BUF_MAX_LEN - buf_in->datalen))