diff options
author | Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | 2021-09-26 23:53:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-26 23:53:00 +0200 |
commit | eac70244894c82eca14af29ed16af478cf3d20a9 (patch) | |
tree | fa6445577998c9d983138aac88d61fa8edbc5281 /src/lib/protocols/quic.c | |
parent | 5ed1930a934662088b76714e1807222151a5ccf3 (diff) |
Fix armhf (#1315)
* Fix unaligned memory accesses with get_u_int64_t at armhf
see: https://bugs.debian.org/993627
* Use get_u_int64_t to avoid unaligned memory access at armhf
see: https://bugs.debian.org/993627
* Update src/include/ndpi_define.h.in
Drop const type from get_u_int64_t, from lnslbrty
Co-authored-by: Bernhard Übelacker <bernhardu@mailbox.org>
Co-authored-by: Toni <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/protocols/quic.c')
-rw-r--r-- | src/lib/protocols/quic.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index 5eb5e1a01..43fcd0759 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -196,14 +196,7 @@ int quic_len(const uint8_t *buf, uint64_t *value) *value = ntohl(*(uint32_t *)buf) & 0x3FFFFFFF; return 4; case 3: - { - u_int64_t n; - - /* Necessary as simple cast crashes on ARM */ - memcpy(&n, buf, sizeof(u_int64_t)); - - *value = ndpi_ntohll(n) & 0x3FFFFFFFFFFFFFFF; - } + *value = ndpi_ntohll(get_u_int64_t(buf, 0)) & 0x3FFFFFFFFFFFFFFF; return 8; default: /* No Possible */ return 0; |