From: Adis Nezirovic Date: Wed, 22 Jan 2020 15:16:48 +0000 (+0100) Subject: BUG/MINOR: cli: Missing arg offset for filter data values. X-Git-Tag: v2.2-dev2~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56dd354b3c55876c4e693fe5eee919e85b2bad53;p=thirdparty%2Fhaproxy.git BUG/MINOR: cli: Missing arg offset for filter data values. We don't properly check for missing data values for additional filter entries, passing out of bounds index to args[], then passing to strlen. Introduced in commit 1a693fc2: (MEDIUM: cli: Allow multiple filter entries for "show table") --- diff --git a/src/stick_table.c b/src/stick_table.c index e4eca989cb..1b397e59e4 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -3620,7 +3620,7 @@ static int table_prepare_data_request(struct appctx *appctx, char **args) if (appctx->ctx.table.data_op[i] < 0) return cli_err(appctx, "Require and operator among \"eq\", \"ne\", \"le\", \"ge\", \"lt\", \"gt\"\n"); - if (!*args[5] || strl2llrc(args[5+3*i], strlen(args[5+3*i]), &appctx->ctx.table.value[i]) != 0) + if (!*args[5+3*i] || strl2llrc(args[5+3*i], strlen(args[5+3*i]), &appctx->ctx.table.value[i]) != 0) return cli_err(appctx, "Require a valid integer value to compare against\n"); }