[PATCH] Fix unaligned access found by addr. sanitizer

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

msuraev at sysmocom.de msuraev at sysmocom.de
Sat Apr 23 15:59:29 UTC 2016


From: Max <msuraev at sysmocom.de>

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

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);
-- 
2.8.1




More information about the OpenBSC mailing list