From: Thierry FOURNIER Date: Tue, 10 Mar 2015 00:55:01 +0000 (+0100) Subject: BUG/MEDIUM: buffer: one byte miss in buffer free space check X-Git-Tag: v1.6-dev1~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fdda6777bffb4f933569c609ba54e24ea5eabf29;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: buffer: one byte miss in buffer free space check Space is not avalaible only if the end of the data inserted is strictly greater than the end of buffer. If these two value are equal, the space is avamaible. --- diff --git a/src/buffer.c b/src/buffer.c index e156991e6c..3c7f6ccb4d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -75,7 +75,7 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int delta = len - (end - pos); - if (bi_end(b) + delta >= b->data + b->size) + if (bi_end(b) + delta > b->data + b->size) return 0; /* no space left */ if (buffer_not_empty(b) &&