Fix unaligned access found by addr. sanitizer
diff mbox

Message ID 1461427169-25465-1-git-send-email-msuraev@sysmocom.de
State New
Headers show

Commit Message

Max April 23, 2016, 3:59 p.m. UTC
From: Max <msuraev@sysmocom.de>

---
 src/gb/gprs_bssgp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Holger Freyther April 23, 2016, 4:09 p.m. UTC | #1
Hi,

please add the ubsan output to the commit message to show which kind of issue has been fixed, please fix the other GPRS issue as well.

holger

Patch
diff mbox

diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index d9d8ccd..8a6d2a1 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 = tlvp_val32_unal(tp, BSSGP_IE_TLLI);
 
 	DEBUGP(DBSSGP, "BSSGP BVCI=%u TLLI=0x%08x Rx SUSPEND\n",
 		ns_bvci, tlli);