]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'bug40076_043' into bug40076_044
authorNick Mathewson <nickm@torproject.org>
Thu, 30 Jul 2020 18:28:11 +0000 (14:28 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 30 Jul 2020 18:28:11 +0000 (14:28 -0400)
1  2 
src/lib/buf/buffers.c

index 95b384bf06e66b12abbdf0dff817d65f70e2059d,d7b73e3807ee40be8bc66306d3b5d8bdf22d6630..a5031a47a67411e27b971491f774f2e841b55c6a
@@@ -692,9 -692,11 +692,11 @@@ buf_move_all(buf_t *buf_out, buf_t *buf
    tor_assert(buf_out);
    if (!buf_in)
      return;
 -  if (BUG(buf_out->datalen >= INT_MAX || buf_in->datalen >= INT_MAX))
+   if (buf_datalen(buf_in) == 0)
+     return;
 +  if (BUG(buf_out->datalen > BUF_MAX_LEN || buf_in->datalen > BUF_MAX_LEN))
      return;
 -  if (BUG(buf_out->datalen >= INT_MAX - buf_in->datalen))
 +  if (BUG(buf_out->datalen > BUF_MAX_LEN - buf_in->datalen))
      return;
  
    if (buf_out->head == NULL) {