From: Pablo Neira Ayuso Date: Tue, 3 Apr 2018 11:03:39 +0000 (+0200) Subject: netlink: floating point exception with concatenations X-Git-Tag: v0.8.4~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=440ea91fbcc9d7d7f50ec12cb65b68ce58a7c5f5;p=thirdparty%2Fnftables.git netlink: floating point exception with concatenations If the length is less than 1 byte, this codepath hits a floating point exception, use div_round_up() as everywhere else in the code. Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/netlink.c b/src/netlink.c index bfa30502..00fac11d 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -371,7 +371,7 @@ static void netlink_gen_concat_data(const struct expr *expr, list_for_each_entry(i, &expr->expressions, list) { assert(i->ops->type == EXPR_VALUE); mpz_export_data(data + offset, i->value, i->byteorder, - i->len / BITS_PER_BYTE); + div_round_up(i->len, BITS_PER_BYTE)); offset += netlink_padded_len(i->len) / BITS_PER_BYTE; }