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.
This commit is contained in:
Christopher Faulet 2020-04-28 10:24:23 +02:00
parent 587c414071
commit 733dd73443

View 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;