]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: Properly handle truncated mysql server messages
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Apr 2020 08:24:23 +0000 (10:24 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Apr 2020 08:24:27 +0000 (10:24 +0200)
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.

src/checks.c

index 774b28cf59f280d9375a3f75bbf43b37b4f2f535..6f132000125bdc944c6f4ca2b14dafe0dec73eab 100644 (file)
@@ -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;