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. --- xtables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xtables.c') diff --git a/xtables.c b/xtables.c index f10cdb70..3c9a13f4 100644 --- a/xtables.c +++ b/xtables.c @@ -426,7 +426,7 @@ int xtables_load_ko(const char *modprobe, bool quiet) * Returns true/false whether number was accepted. On failure, *value has * undefined contents. */ -bool xtables_strtoul(const char *s, char **end, unsigned long *value, +bool xtables_strtoul(const char *s, char **end, unsigned long long *value, unsigned long min, unsigned long max) { unsigned long v; @@ -454,7 +454,7 @@ bool xtables_strtoul(const char *s, char **end, unsigned long *value, bool xtables_strtoui(const char *s, char **end, unsigned int *value, unsigned int min, unsigned int max) { - unsigned long v; + unsigned long long v; bool ret; ret = xtables_strtoul(s, end, &v, min, max); -- cgit v1.2.3