From 743afeed3336c99ef3b4b5e355c9baf49b2cf03b Mon Sep 17 00:00:00 2001 From: Emeric Brun Date: Mon, 15 Feb 2021 14:12:06 +0100 Subject: [PATCH] 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 --- src/dns.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dns.c b/src/dns.c index e1f9539e9..9e44dd6c4 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 */