From 440ea91fbcc9d7d7f50ec12cb65b68ce58a7c5f5 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 3 Apr 2018 13:03:39 +0200 Subject: 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 --- src/netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3