[PATCH nft 2/2] netlink: floating point exception

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

 



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 <pablo@xxxxxxxxxxxxx>
---
 src/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/netlink.c b/src/netlink.c
index bfa30502a2b2..00fac11d6156 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;
 		}
 
-- 
2.11.0

--
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