]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: fix endless loop on 64 bit when parsing binops
authorPatrick McHardy <kaber@trash.net>
Sun, 9 Dec 2012 13:55:03 +0000 (14:55 +0100)
committerPatrick McHardy <kaber@trash.net>
Sun, 9 Dec 2012 13:55:22 +0000 (14:55 +0100)
mpz_scan1() returns ULONG_MAX when no more bits are found. Due to assignment
to an unsigned int, this value was truncated on 64 bit and the loop never
terminated.

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/netlink_delinearize.c

index d0ab335b9ceb9093d77f64f2ce244cbc909ea301..4ecf4f57e4902ae2e269582855f50a1c9f9b0d99 100644 (file)
@@ -555,7 +555,7 @@ static void expr_postprocess(struct rule_pp_ctx *ctx,
                             struct stmt *stmt, struct expr **exprp)
 {
        struct expr *expr = *exprp, *i;
-       unsigned int n;
+       unsigned long n;
 
        //pr_debug("%s len %u\n", expr->ops->name, expr->len);