summaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-04-23 19:37:58 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-24 11:12:41 +0200
commit27e8036d418181e390809c8668d15a9ab425be59 (patch)
treeee124296ceb52052433a2a68856fe5d1f3108f6a /src/gb/gprs_ns.c
parent8a5346ba2f7ed7b4e69d32397b99d11c14694a2a (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_ns.c')
-rw-r--r--src/gb/gprs_ns.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index a29c9464..6879c708 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -934,8 +934,8 @@ static int gprs_ns_rx_reset_ack(struct gprs_nsvc **nsvc, struct msgb *msg)
return -EINVAL;
}
- nsvci = ntohs(*(uint16_t *) TLVP_VAL(&tp, NS_IE_VCI));
- nsei = ntohs(*(uint16_t *) TLVP_VAL(&tp, NS_IE_NSEI));
+ nsvci = ntohs(tlvp_val16_unal(&tp, NS_IE_VCI));
+ nsei = ntohs(tlvp_val16_unal(&tp, NS_IE_NSEI));
LOGP(DNS, LOGL_INFO, "NSVCI=%u%s Rx NS RESET ACK (NSEI=%u, NSVCI=%u)\n",
(*nsvc)->nsvci, (*nsvc)->nsvci_is_valid ? "" : "(invalid)",