summaryrefslogtreecommitdiff
path: root/src/lib/buf/buffers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/buf/buffers.c')
-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 4d026bd37d..ace5bdc4a4 100644
--- a/src/lib/buf/buffers.c
+++ b/src/lib/buf/buffers.c
@@ -689,6 +689,8 @@ buf_move_all(buf_t *buf_out, buf_t *buf_in)
tor_assert(buf_out);
if (!buf_in)
return;
+ if (buf_datalen(buf_in) == 0)
+ return;
if (BUG(buf_out->datalen >= INT_MAX || buf_in->datalen >= INT_MAX))
return;
if (BUG(buf_out->datalen >= INT_MAX - buf_in->datalen))