From: Jan Engelhardt Date: Mon, 2 May 2011 00:43:15 +0000 (+0200) Subject: libxtables: fix assignment in wrong offset (XTTYPE_UINT*RC) X-Git-Tag: v1.4.11~18^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0787a82873fe9db5dea478942b183e6ff2a8500d;p=thirdparty%2Fiptables.git libxtables: fix assignment in wrong offset (XTTYPE_UINT*RC) Signed-off-by: Jan Engelhardt --- diff --git a/xtoptions.c b/xtoptions.c index 5b1df889..1cfc8440 100644 --- a/xtoptions.c +++ b/xtoptions.c @@ -190,7 +190,6 @@ static void xtopt_parse_mint(struct xt_option_call *cb) xt_params->exit_err(PARAMETER_PROBLEM, "%s: Argument to \"--%s\" has unexpected " "characters.\n", cb->ext_name, entry->name); - ++cb->nvals; if (cb->nvals < ARRAY_SIZE(cb->val.u32_range)) { if (entry->type == XTTYPE_UINT8RC) cb->val.u8_range[cb->nvals] = value; @@ -201,6 +200,7 @@ static void xtopt_parse_mint(struct xt_option_call *cb) else if (entry->type == XTTYPE_UINT64RC) cb->val.u64_range[cb->nvals] = value; } + ++cb->nvals; if (entry->flags & XTOPT_PUT) { if (entry->type == XTTYPE_UINT8RC) *(uint8_t *)put = value;