common/iobuf.c: Buffered data should not be processed by new filters.
authorNeal H. Walfield <neal@g10code.com>
Mon, 17 Aug 2015 09:56:42 +0000 (11:56 +0200)
committerNeal H. Walfield <neal@g10code.com>
Thu, 20 Aug 2015 12:16:24 +0000 (14:16 +0200)
commit827cc922d84d8113d4f13ebbed1314e03da5f7d2
tree64589acc2ea9283826f3b17b270f15f0133c6f38
parent616181f3c757160af8539869a6d929faca4962c4
common/iobuf.c: Buffered data should not be processed by new filters.

* common/iobuf.c (iobuf_push_filter2): If the pipeline is an output or
temp pipeline, the new filter shouldn't assume ownership of the old
head's internal buffer: the data was written before the filter was
added.
* common/t-iobuf.c (double_filter): New function.
(main): Add test cases for the above bug.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
common/iobuf.c
common/t-iobuf.c