forked from osmocom/wireshark
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>
This commit is contained in:
parent
4a01a952ed
commit
3bbcd32d95
1 changed files with 3 additions and 2 deletions
|
@ -21,6 +21,7 @@
|
||||||
#include <wsutil/crc7.h> /* For FP data header and control frame CRC. */
|
#include <wsutil/crc7.h> /* For FP data header and control frame CRC. */
|
||||||
#include <wsutil/crc16-plain.h> /* For FP Payload CRC. */
|
#include <wsutil/crc16-plain.h> /* For FP Payload CRC. */
|
||||||
#include <wsutil/crc11.h> /* For FP EDCH header CRC. */
|
#include <wsutil/crc11.h> /* For FP EDCH header CRC. */
|
||||||
|
#include <wsutil/pint.h>
|
||||||
|
|
||||||
#include "packet-umts_fp.h"
|
#include "packet-umts_fp.h"
|
||||||
#include "packet-nbap.h"
|
#include "packet-nbap.h"
|
||||||
|
@ -3945,12 +3946,12 @@ generate_ue_id_for_heur(packet_info *pinfo)
|
||||||
/* srcXor: [ ------- Source Address ------- ] (4 bytes)*/
|
/* srcXor: [ ------- Source Address ------- ] (4 bytes)*/
|
||||||
/* XOR */
|
/* XOR */
|
||||||
/* [ Source Port ][ Source Port ] (4 bytes)*/
|
/* [ 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)*/
|
/* dstXor: [ ---- Destination Address ---- ] (4 bytes)*/
|
||||||
/* XOR */
|
/* XOR */
|
||||||
/* [ - Dest Port - ][ - Dest Port - ] (4 bytes)*/
|
/* [ - 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;
|
return srcXor ^ dstXor;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue