[core] fix buffer_substr_replace() extend (fixes
This bug affects mod_proxy header rewriting to/from backend
(regression in lighttpd 1.4.60 - lighttpd 1.4.65)
(thx k.trempala)
x-ref:
"Wrong buffer size in function buffer_substr_replace() in file buffer.c"
@@ -460,7 +460,7 @@ void buffer_substr_replace (buffer * const restrict b, const size_t offset,
const size_t rlen = buffer_clen(replace);
if (rlen > len) {
- buffer_extend(b, blen-len+rlen);
+ buffer_extend(b, rlen-len);
memmove(b->ptr+offset+rlen, b->ptr+offset+len, blen-offset-len);
}
