Re: [ANNOUNCE] Release of iptables 1.4.0rc1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Engelhardt wrote:
On Oct 16 2007 10:44, Patrick McHardy wrote:

static int parse_counters(char *string, struct ip6t_counters *ctr)
{
-	return (sscanf(string, "[%llu:%llu]", (unsigned long long *)&ctr->pcnt, (unsigned long long *)&ctr->bcnt) == 2);
+	u_int64_t *pcnt, *bcnt;
+
+	pcnt = &ctr->pcnt;
+	bcnt = &ctr->bcnt;
+	return (sscanf(string, "[%llu:%llu]", (unsigned long long *)pcnt, (unsigned long long *)bcnt) == 2);
}

This is also wrong (even though it may work in practice), since unsigned long
long does not necessarily need to be 64 bit (it may be larger, and if so,
you'll smash the stack).
What you want is:


Indeed, that is obviously wrong. I'll fix that and the other occurences.
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux