diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-05-28 15:02:05 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-05-28 15:02:05 -0400 |
commit | ccf1c70800ef4fd7220599a1f6214ac592d51a3c (patch) | |
tree | 9d485acca29642497d82a3c47a5d0d8295befa56 /src/resolve/test-dns-packet.c | |
parent | 16690d0e15964b896531dfcc38fd13576745d77d (diff) | |
parent | 9ae84244107ff4bf0f49d1c68e6d4eed3be99b6c (diff) |
Merge pull request #3360 from glaubitz/master
Fix multiple unaligned accesses in test-dns-packet and sd-dhcp-server.
Diffstat (limited to 'src/resolve/test-dns-packet.c')
-rw-r--r-- | src/resolve/test-dns-packet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resolve/test-dns-packet.c b/src/resolve/test-dns-packet.c index c232a69ce1..41e5c1caa5 100644 --- a/src/resolve/test-dns-packet.c +++ b/src/resolve/test-dns-packet.c @@ -29,6 +29,7 @@ #include "resolved-dns-rr.h" #include "string-util.h" #include "strv.h" +#include "unaligned.h" #define HASH_KEY SD_ID128_MAKE(d3,1e,48,90,4b,fa,4c,fe,af,9d,d5,a1,d7,2e,8a,b1) @@ -56,7 +57,7 @@ static void test_packet_from_file(const char* filename, bool canonical) { const char *s, *s2; uint64_t hash1, hash2; - packet_size = le64toh( *(uint64_t*)(data + offset) ); + packet_size = unaligned_read_le64(data + offset); assert_se(packet_size > 0); assert_se(offset + 8 + packet_size <= data_size); |