NAS message encoding: avoid unaligned access through memcpy()
This commit is contained in:
committed by
Laurent THOMAS
parent
e94f59edb1
commit
712988d437
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user