From: Emeric Brun Date: Mon, 15 Feb 2021 13:12:06 +0000 (+0100) Subject: BUG/MINOR: dns: missing test writing in output channel in session handler X-Git-Tag: v2.4-dev9~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=743afeed3336c99ef3b4b5e355c9baf49b2cf03b;p=thirdparty%2Fhaproxy.git BUG/MINOR: dns: missing test writing in output channel in session handler This patch fix a case which should never happen writing in output channel since we check available room before This patch should fix github issue #1132 --- diff --git a/src/dns.c b/src/dns.c index e1f9539e99..9e44dd6c4a 100644 --- a/src/dns.c +++ b/src/dns.c @@ -592,7 +592,15 @@ static void dns_session_io_handler(struct appctx *appctx) } trash.data += len; - ci_putchk(si_ic(si), &trash); + if (ci_putchk(si_ic(si), &trash) == -1) { + /* should never happen since we + * check available_room is large + * enought here. + */ + si_rx_room_blk(si); + ret = 0; + break; + } if (ds->tx_msg_offset) { /* msg was not fully processed, we must be awake to drain pending data */