From: Christopher Faulet Date: Tue, 28 Apr 2020 08:24:23 +0000 (+0200) Subject: BUG/MINOR: checks: Properly handle truncated mysql server messages X-Git-Tag: v2.2-dev7~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=733dd73443b75143944e566f698014c6c8a522b5;p=thirdparty%2Fhaproxy.git BUG/MINOR: checks: Properly handle truncated mysql server messages If a message is not fully received from a mysql server, depending on last_read value, an error must be reported or we must wait for more data. The first if statement must not check last_read. Partly fixes issue #600. No backport needed. --- diff --git a/src/checks.c b/src/checks.c index 774b28cf59..6f13200012 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1202,7 +1202,7 @@ static enum tcpcheck_eval_ret tcpcheck_mysql_expect_packet(struct check *check, /* 3 Bytes for the packet length and 1 byte for the sequence id */ - if (!last_read && b_data(&check->bi) < offset+4) { + if (b_data(&check->bi) < offset+4) { if (!last_read) goto wait_more_data;