From 82e0a693110be85b6ebc023b4dbf5e798ac60bdc Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 4 Dec 2014 14:18:59 +0100 Subject: payload: fix endianess issue in payload_expr_pctx_update() Use constant_data_ptr() to point to the right memory position on big endian when exporting data that is stored in a larger variable. Signed-off-by: Pablo Neira Ayuso Tested-by: Christophe Leroy --- src/datatype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/datatype.c') diff --git a/src/datatype.c b/src/datatype.c index fd3573ef..729e63b0 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -158,8 +158,8 @@ void symbolic_constant_print(const struct symbol_table *tbl, /* Export the data in the correct byteorder for comparison */ assert(expr->len / BITS_PER_BYTE <= sizeof(val)); - mpz_export_data(&val, expr->value, expr->byteorder, - expr->len / BITS_PER_BYTE); + mpz_export_data(constant_data_ptr(val, expr->len), expr->value, + expr->byteorder, expr->len / BITS_PER_BYTE); for (s = tbl->symbols; s->identifier != NULL; s++) { if (val == s->value) -- cgit v1.2.3