common/iobuf.c: Add some sanity checks to catch programmer bugs.
authorNeal H. Walfield <neal@g10code.com>
Mon, 17 Aug 2015 10:52:20 +0000 (12:52 +0200)
committerNeal H. Walfield <neal@g10code.com>
Thu, 20 Aug 2015 12:16:27 +0000 (14:16 +0200)
commitc5da750cf3d53277fe6d86776bfe0d2304b05151
tree0e001abbf144ecb776553c02325c13860509977c
parente291b631c3b1aedf529078190cd51e2acfcd1d92
common/iobuf.c: Add some sanity checks to catch programmer bugs.

* common/iobuf.c (iobuf_alloc): Check that BUFSIZE is not 0.
(iobuf_readbyte): Check that A is an input filter.  Check that the
amount of read data is at most the amount of buffered data.
(iobuf_read): Check that A is an input filter.
(iobuf_writebyte): Check that A is not an input filter.
(iobuf_writestr): Check that A is not an input filter.
(iobuf_flush_temp): Check that A is not an input filter.

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