]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: lua: segfault with buffer_replace2
authorThierry FOURNIER <tfournier@exceliance.fr>
Sat, 7 Mar 2015 13:38:50 +0000 (14:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Mar 2015 17:12:59 +0000 (18:12 +0100)
commitd2b597aa10abdff5ec3b58bffe87fb99a9423776
tree9c3ec07edc0dc8ec10c25f767938520556297531
parentcd9084f77683106ace2fb863080e7d10e71c39fc
BUG/MEDIUM: lua: segfault with buffer_replace2

The function buffer_contig_space() returns the contiguous space avalaible
to add data (at the end of the input side) while the function
hlua_channel_send_yield() needs to insert data starting at p. Here we
introduce a new function bi_space_for_replace() which returns the amount
of space that can be inserted at the head of the input side with one of
the buffer_replace* functions.

This patch proposes a function that returns the space avalaible after buf->p.
include/common/buffer.h
src/hlua.c