diff options
author | Matt Turner <mattst88@gmail.com> | 2018-10-17 12:32:54 -0700 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-19 14:56:08 +0200 |
commit | dc240913458d591f59b52b3899d3fc3c5d6ec6ce (patch) | |
tree | b43acfe0306f2ab42a5f5abccc42420fe6a5508c /src/expr/match.c | |
parent | aecc936180d302947ecfab5dacf267a701a5d84c (diff) |
src: Use memcpy() to handle potentially unaligned data
Rolf Eike Beer <eike@sf-mail.de> reported that nft-expr_quota-test fails
with a SIGBUS on SPARC due to unaligned accesses. This patch resolves
that and fixes additional sources of unaligned accesses matching the
same pattern. Both nft-expr_quota-test and nft-expr_objref-test
generated unaligned accesses on DEC Alpha.
Bug: https://bugs.gentoo.org/666448
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/match.c')
-rw-r--r-- | src/expr/match.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr/match.c b/src/expr/match.c index 85dd79c..2b3321d 100644 --- a/src/expr/match.c +++ b/src/expr/match.c @@ -46,7 +46,7 @@ nftnl_expr_match_set(struct nftnl_expr *e, uint16_t type, (const char *)data); break; case NFTNL_EXPR_MT_REV: - mt->rev = *((uint32_t *)data); + memcpy(&mt->rev, data, sizeof(mt->rev)); break; case NFTNL_EXPR_MT_INFO: if (e->flags & (1 << NFTNL_EXPR_MT_INFO)) |