ranap_msg_factory: use OCTET_STRING_fromBuf() in ranap_new_msg_dt()

When using asn1c, we cannot use buffers allocated elsewhere and/or on
the stack as input into encoding.
This commit is contained in:
Harald Welte 2015-12-24 15:33:21 +01:00
parent ea98b6f6d6
commit 57d873392c
1 changed files with 1 additions and 2 deletions

View File

@ -180,8 +180,7 @@ struct msgb *ranap_new_msg_dt(uint8_t sapi, const uint8_t *nas, unsigned int nas
else
ies.sapi = RANAP_SAPI_sapi_0;
ies.nas_pdu.buf = (uint8_t *) nas;
ies.nas_pdu.size = nas_len;
OCTET_STRING_fromBuf(&ies.nas_pdu, nas, nas_len);
/* ies -> dt */
rc = ranap_encode_directtransferies(&dt, &ies);