]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib: If two istreams share one parent, i_stream_get_data() may have returned corrupte...
authorTimo Sirainen <tss@iki.fi>
Thu, 19 Jun 2014 10:52:36 +0000 (13:52 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 19 Jun 2014 10:52:36 +0000 (13:52 +0300)
commitf5982bb5b0a704e88fa2b44b0b74e365d13103b9
tree14382d41114a8e236528aaf74b85eed854230db1
parentce8daf893a2df42207bb0a08220e367af993a3ab
lib: If two istreams share one parent, i_stream_get_data() may have returned corrupted data to another.
This happened only for istreams that used parent's buffer directly instead
of having their own buffer. For now at least we've solved this by truncating
the other stream's buffer so it needs to be read again. Hopefully this is
good enough.

Added also unit test to check this functionality.
src/lib/Makefile.am
src/lib/istream.c
src/lib/test-istream.c [new file with mode: 0644]
src/lib/test-lib.c
src/lib/test-lib.h