diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-12-04 14:18:59 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-12-05 11:38:42 +0100 |
commit | 82e0a693110be85b6ebc023b4dbf5e798ac60bdc (patch) | |
tree | cc7bc94cc7cd60bb85cd5bfe755a8ace5296dc09 /src/payload.c | |
parent | 77272b500f294ab726e265ec972a35d8a542fe69 (diff) |
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 <pablo@netfilter.org>
Tested-by: Christophe Leroy <christophe.leroy@c-s.fr>
Diffstat (limited to 'src/payload.c')
-rw-r--r-- | src/payload.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/payload.c b/src/payload.c index ebf8079b..83742fb0 100644 --- a/src/payload.c +++ b/src/payload.c @@ -79,8 +79,8 @@ static void payload_expr_pctx_update(struct proto_ctx *ctx, /* Export the data in the correct byte order */ assert(right->len / BITS_PER_BYTE <= sizeof(proto)); - mpz_export_data(&proto, right->value, right->byteorder, - right->len / BITS_PER_BYTE); + mpz_export_data(constant_data_ptr(proto, right->len), right->value, + right->byteorder, right->len / BITS_PER_BYTE); base = ctx->protocol[left->payload.base].desc; desc = proto_find_upper(base, proto); |