From 3bbcd32d95b1450e883ee9cab801aa6544da1e56 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Wed, 16 May 2018 23:05:38 +0200 Subject: [PATCH] UMTS FP: fix a load of misaligned address reported by UBSan load of misaligned address 0x61d00032009a for type 'const guint32', which requires 4 byte alignment Change-Id: Ie609ead4e2dada97cb1348c8a35c11dbd1624213 Reviewed-on: https://code.wireshark.org/review/27606 Reviewed-by: Pascal Quantin Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-umts_fp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c index 8d8f2bf509..45e85f3c5c 100644 --- a/epan/dissectors/packet-umts_fp.c +++ b/epan/dissectors/packet-umts_fp.c @@ -21,6 +21,7 @@ #include /* For FP data header and control frame CRC. */ #include /* For FP Payload CRC. */ #include /* For FP EDCH header CRC. */ +#include #include "packet-umts_fp.h" #include "packet-nbap.h" @@ -3945,12 +3946,12 @@ generate_ue_id_for_heur(packet_info *pinfo) /* srcXor: [ ------- Source Address ------- ] (4 bytes)*/ /* XOR */ /* [ Source Port ][ Source Port ] (4 bytes)*/ - int srcXor = *((const guint32*)pinfo->src.data) ^ ((pinfo->srcport << 16) | (pinfo->srcport)); + int srcXor = pntoh32(pinfo->src.data) ^ ((pinfo->srcport << 16) | (pinfo->srcport)); /* dstXor: [ ---- Destination Address ---- ] (4 bytes)*/ /* XOR */ /* [ - Dest Port - ][ - Dest Port - ] (4 bytes)*/ - int dstXor = *((const guint32*)pinfo->dst.data) ^ ((pinfo->destport << 16) | (pinfo->destport)); + int dstXor = pntoh32(pinfo->dst.data) ^ ((pinfo->destport << 16) | (pinfo->destport)); return srcXor ^ dstXor; } else {