From: Willy Tarreau Date: Fri, 15 Jan 2010 22:38:27 +0000 (+0100) Subject: [BUG] buffers: remove remains of wrong obsolete length check X-Git-Tag: v1.4-dev7~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43a7e6620b79e0e771dbaf2a60b57c96d9ba60e5;p=thirdparty%2Fhaproxy.git [BUG] buffers: remove remains of wrong obsolete length check A check was performed in buffer_replace2() to compare buffer length with its read pointer. This has been wrong for a long time, though it only has an impact when dealing with keep-alive requests/responses. In theory this should be backported but the check has no impact without keep-alive. --- diff --git a/src/buffers.c b/src/buffers.c index f9b5aa46bb..4f14507396 100644 --- a/src/buffers.c +++ b/src/buffers.c @@ -230,12 +230,6 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int if (delta + b->r >= b->data + b->size) return 0; /* no space left */ - if (b->data + b->l < end) { - /* The data has been stolen, we could have crashed. - * Maybe we should abort() ? */ - return 0; - } - /* first, protect the end of the buffer */ memmove(end + delta, end, b->r - end);