Commit 712988d4 authored by Robert Schmidt's avatar Robert Schmidt Committed by Laurent THOMAS

NAS message encoding: avoid unaligned access through memcpy()

parent e94f59ed
...@@ -535,7 +535,8 @@ int nas_message_encode( ...@@ -535,7 +535,8 @@ int nas_message_encode(
#endif #endif
emm_security_context); emm_security_context);
/* Set the message authentication code of the NAS message */ /* Set the message authentication code of the NAS message */
*(uint32_t*)(buffer + sizeof(uint8_t)) = htonl(mac); uint32_t mac_nl = htonl(mac);
memcpy(buffer + sizeof(uint8_t), &mac_nl, sizeof(mac_nl));
if (emm_security_context) { if (emm_security_context) {
#ifdef NAS_MME #ifdef NAS_MME
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment