Ensure buffer in bio_writer_t is properly increased
authorTobias Brunner <tobias@strongswan.org>
Tue, 4 Jun 2013 15:29:40 +0000 (17:29 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 11 Jun 2013 09:03:13 +0000 (11:03 +0200)
commiteeb73dec7961f56cadd92c5d56a3a7009dfff22d
tree19cf07488785a84b0cbd5c028d3add917c2ec715
parentb4029a4aae567851c414194dbf99040f27fb16e5
Ensure buffer in bio_writer_t is properly increased

The previous code was problematic if bufsize/increase was smaller than 8
and an u_int64_t was written when the buffer was too small.  Also, for
large chunks and small bufsizes realloc() was called several times
instead of just once.
src/libstrongswan/bio/bio_writer.c