asn1c: MME crash is resolved (#783)

This commit is contained in:
Sukchan Lee 2021-02-02 14:27:03 -05:00
parent f47f65a51c
commit e7cb25ac9b
2 changed files with 13 additions and 7 deletions

View File

@ -52,9 +52,19 @@ CHOICE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
} else {
if(specs->ext_start == -1)
ASN__DECODE_FAILED;
value = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
if(value < 0) ASN__DECODE_STARVED;
value += specs->ext_start;
/* modified by acetcom for https://github.com/open5gs/open5gs/issues/783 */
#if 1
if (ct) {
#endif
value = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
if(value < 0) ASN__DECODE_STARVED;
value += specs->ext_start;
/* modified by acetcom for https://github.com/open5gs/open5gs/issues/783 */
#if 1
} else {
value = specs->ext_start;
}
#endif
if((unsigned)value >= td->elements_count)
ASN__DECODE_FAILED;
}

View File

@ -188,7 +188,6 @@ static void s1ap_message_test7(abts_case *tc, void *data)
ogs_pkbuf_free(pkbuf);
}
#if 0
static void s1ap_message_test8(abts_case *tc, void *data)
{
/* ENBDirectInformationTransferRAN-INFORMATION-REQUEST */
@ -238,7 +237,6 @@ static void s1ap_message_test9(abts_case *tc, void *data)
ogs_pkbuf_free(pkbuf);
}
#endif
static void s1ap_message_test10(abts_case *tc, void *data)
{
@ -276,10 +274,8 @@ abts_suite *test_s1ap_message(abts_suite *suite)
abts_run_test(suite, s1ap_message_test5, NULL);
abts_run_test(suite, s1ap_message_test6, NULL);
abts_run_test(suite, s1ap_message_test7, NULL);
#if 0
abts_run_test(suite, s1ap_message_test8, NULL);
abts_run_test(suite, s1ap_message_test9, NULL);
#endif
abts_run_test(suite, s1ap_message_test10, NULL);
return suite;