From 7eb73bc92abebe60dde5626673b342a3d9601eb2 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Thu, 23 Sep 2021 13:24:49 +0200 Subject: QUIC: fix old GQUIC versions on big-endian machines (#1313) --- src/lib/protocols/quic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/protocols/quic.c') diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index 7db718ac8..5eb5e1a01 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -1343,7 +1343,7 @@ static void process_chlo(struct ndpi_detection_module_struct *ndpi_struct, #endif return; } - num_tags = (*(uint16_t *)&crypto_data[4]); + num_tags = le16toh(*(uint16_t *)&crypto_data[4]); tag_offset_start = 8 + 8 * num_tags; prev_offset = 0; @@ -1351,7 +1351,7 @@ static void process_chlo(struct ndpi_detection_module_struct *ndpi_struct, if(8 + 8 * i + 8 >= crypto_data_len) break; tag = &crypto_data[8 + 8 * i]; - offset = *((u_int32_t *)&crypto_data[8 + 8 * i + 4]); + offset = le32toh(*((u_int32_t *)&crypto_data[8 + 8 * i + 4])); if(prev_offset > offset) break; len = offset - prev_offset; -- cgit v1.2.3