aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-umts_fp.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-05-16 23:05:38 +0200
committerAnders Broman <a.broman58@gmail.com>2018-05-17 04:15:28 +0000
commit3bbcd32d95b1450e883ee9cab801aa6544da1e56 (patch)
tree24b013fdef65c3fbf55de2abb12f27c0bcf894bf /epan/dissectors/packet-umts_fp.c
parent4a01a952edd7881b0d706e2cfe8f0c5571828987 (diff)
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 <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-umts_fp.c')
-rw-r--r--epan/dissectors/packet-umts_fp.c5
1 files 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 <wsutil/crc7.h> /* For FP data header and control frame CRC. */
#include <wsutil/crc16-plain.h> /* For FP Payload CRC. */
#include <wsutil/crc11.h> /* For FP EDCH header CRC. */
+#include <wsutil/pint.h>
#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 {