diff options
author | JP Abgrall <jpa@google.com> | 2011-05-18 20:26:14 -0700 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-05-20 16:08:27 +0200 |
commit | 2305d5fb42fc059f38fc1bdf53411dbeecdb310b (patch) | |
tree | 533581021a3f92c391af249cb28a59ed29ea51c2 /xtoptions.c | |
parent | 67db7615580f5c3490a39310f5adcb4e767ea6a8 (diff) |
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.
Diffstat (limited to 'xtoptions.c')
-rw-r--r-- | xtoptions.c | 4 |
1 files changed, 2 insertions, 2 deletions
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", |