]> git.meshlink.io Git - utcp/commit
Fix buffer resizing logic in buffer_put_at().
authorGuus Sliepen <guus@meshlink.io>
Thu, 17 Dec 2015 17:07:19 +0000 (18:07 +0100)
committerGuus Sliepen <guus@sliepen.org>
Sun, 2 Jul 2017 10:16:15 +0000 (12:16 +0200)
commit16ecd6d75bfabb97193581bcc8095652759cdb8e
tree352211bccaf396474d3cfb0fdb250589e89bcd4c
parent5bad36c4252858693b5cfe59a94540ccd2b0be42
Fix buffer resizing logic in buffer_put_at().

When growing the buffer when it's not big enough for new data, the
current size is doubled repeatedly until it is big enough for the new
data. The required new size is stored in the variable "required",
however the doubling loop exited when the new size was at least
buf->used + len, which might be much smaller than "required" if an
out-of-order packet is received.
utcp.c