From 2305d5fb42fc059f38fc1bdf53411dbeecdb310b Mon Sep 17 00:00:00 2001 From: JP Abgrall Date: Wed, 18 May 2011 20:26:14 -0700 Subject: libxt_quota: make sure uint64 is not truncated The xtables_strtoul() would cram a long long into a long. The parse_int would try to cram a UINT64 into a long. --- xtoptions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xtoptions.c') diff --git a/xtoptions.c b/xtoptions.c index 3c3ce5f1..ec2269b2 100644 --- a/xtoptions.c +++ b/xtoptions.c @@ -105,7 +105,7 @@ static void xtopt_parse_int(struct xt_option_call *cb) { const struct xt_option_entry *entry = cb->entry; unsigned long long lmin = 0, lmax = UINT32_MAX; - unsigned int value; + unsigned long long value; if (entry->type == XTTYPE_UINT8) lmax = UINT8_MAX; @@ -118,7 +118,7 @@ static void xtopt_parse_int(struct xt_option_call *cb) if (cb->entry->max != 0) lmax = cb->entry->max; - if (!xtables_strtoui(cb->arg, NULL, &value, lmin, lmax)) + if (!xtables_strtoul(cb->arg, NULL, &value, lmin, lmax)) xt_params->exit_err(PARAMETER_PROBLEM, "%s: bad value for option \"--%s\", " "or out of range (%llu-%llu).\n", -- cgit v1.2.3