]> granicus.if.org Git - libevent/commit
Address issue #306 - use misalign instead of evbuffer_remove 20-issue306-fix
authorMark Ellzey <socket@gmail.com>
Thu, 24 Dec 2015 03:03:57 +0000 (19:03 -0800)
committerMark Ellzey <socket@gmail.com>
Thu, 24 Dec 2015 03:03:57 +0000 (19:03 -0800)
commitafca576a052fb8c83e771435169615fce5c56686
tree6e1fa3e4973902c753c9c35e7f8c25328a0b2ee3
parenta4a7c1aeddc3100cb8d24450bd9adcd2d1cd9a56
Address issue #306 - use misalign instead of evbuffer_remove

when evbuffer_add_file is called and mmap is used, if the offset
argument is >0, a mistake happens: add_file removes "offset" byts
from the front of the evbuffer.

So that means any data that was previously on the buffer is trimmed
off by "offset" bytes. Whoops.

A onelinter fix: don't use evbuffer_drain for the offset, instead,
just modify the misalign variable on the newly created chain.
buffer.c