diff options
author | Max <msuraev@sysmocom.de> | 2016-04-23 19:37:58 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-04-24 11:12:41 +0200 |
commit | 27e8036d418181e390809c8668d15a9ab425be59 (patch) | |
tree | ee124296ceb52052433a2a68856fe5d1f3108f6a /src/gb/gprs_bssgp.c | |
parent | 8a5346ba2f7ed7b4e69d32397b99d11c14694a2a (diff) |
Fix unaligned access found by addr. sanitizer
gprs_bssgp.c:461:9: runtime error: load of misaligned address
0x62100001a66b for type 'uint32_t', which requires 4 byte alignment
gprs_ns.c:937:16: runtime error: load of misaligned address
0x61d00002a97f for type 'uint16_t', which requires 2 byte alignment
Diffstat (limited to 'src/gb/gprs_bssgp.c')
-rw-r--r-- | src/gb/gprs_bssgp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index d9d8ccd8..3ad2f297 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -416,7 +416,7 @@ static int bssgp_rx_suspend(struct msgb *msg, struct tlv_parsed *tp) return bssgp_tx_status(BSSGP_CAUSE_MISSING_MAND_IE, NULL, msg); } - tlli = ntohl(*(uint32_t *)TLVP_VAL(tp, BSSGP_IE_TLLI)); + tlli = ntohl(tlvp_val32_unal(tp, BSSGP_IE_TLLI)); DEBUGP(DBSSGP, "BSSGP BVCI=%u TLLI=0x%08x Rx SUSPEND\n", ns_bvci, tlli); @@ -458,7 +458,7 @@ static int bssgp_rx_resume(struct msgb *msg, struct tlv_parsed *tp) return bssgp_tx_status(BSSGP_CAUSE_MISSING_MAND_IE, NULL, msg); } - tlli = ntohl(*(uint32_t *)TLVP_VAL(tp, BSSGP_IE_TLLI)); + tlli = ntohl(tlvp_val32_unal(tp, BSSGP_IE_TLLI)); suspend_ref = *TLVP_VAL(tp, BSSGP_IE_SUSPEND_REF_NR); DEBUGP(DBSSGP, "BSSGP BVCI=%u TLLI=0x%08x Rx RESUME\n", ns_bvci, tlli); |