summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-05 14:26:26 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-11 20:37:12 +0200
commit8dfe9690c51c13d71cca6e9c3e7dfddb7d03a8de (patch)
tree5b36447d8fc733127db8943ae598abab93f185c7 /openbsc
parentfafb0742683fb069ea88355c513290c6bb4373b4 (diff)
iu.c: check return value of ranap_parse_lai()
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libiu/iu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c
index 5edf22126..ea99f172d 100644
--- a/openbsc/src/libiu/iu.c
+++ b/openbsc/src/libiu/iu.c
@@ -157,7 +157,10 @@ static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *i
uint16_t sai;
struct msgb *msg = msgb_alloc(256, "RANAP->NAS");
- ranap_parse_lai(&ra_id, &ies->lai);
+ if (ranap_parse_lai(&ra_id, &ies->lai) != 0) {
+ LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n");
+ return -1;
+ }
sai = asn1str_to_u16(&ies->sai.sAC);
msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size);
memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size);
@@ -176,7 +179,10 @@ static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies)
struct msgb *msg = msgb_alloc(256, "RANAP->NAS");
if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) {
- ranap_parse_lai(&_ra_id, &ies->lai);
+ if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) {
+ LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n");
+ return -1;
+ }
ra_id = &_ra_id;
if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) {
_ra_id.rac = asn1str_to_u8(&ies->rac);