From 28d7876a0cb0f2e8fa46c216937d361b0d7bcfbc Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Sat, 20 Feb 2021 12:15:22 +0100 Subject: [PATCH] BUG/MINOR: server: Fix test on number of fields allowed in a server-state line When a server-state line is parsed, a test is performed to be sure there is enough but not too much fields. However the test is buggy. The bug was introduced in the commit ea2cdf55e ("MEDIUM: server: Don't introduce a new server-state file version"). No backport needed. --- src/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index c7ad95029..732643cbc 100644 --- a/src/server.c +++ b/src/server.c @@ -3166,8 +3166,8 @@ static void srv_state_parse_line(char *buf, const int version, char **params, ch /* if line is incomplete line, then ignore it. * otherwise, update useful flags */ if (version == 1 && - arg < SRV_STATE_FILE_MIN_FIELDS_VERSION_1 && - arg > SRV_STATE_FILE_MAX_FIELDS_VERSION_1) + (arg < SRV_STATE_FILE_MIN_FIELDS_VERSION_1 || + arg > SRV_STATE_FILE_MAX_FIELDS_VERSION_1)) params[0] = NULL; }