Solve the problem that information object table with one entry can not be properly handled
E-RABToBeSetupItemBearerSUReqIEs S1AP-PROTOCOL-IES ::= {
{ ID id-E-RABToBeSetupItemBearerSUReq CRITICALITY reject TYPE E-RABToBeSetupItemBearerSUReq PRESENCE mandatory },
...
}
result in 'FATAL: Information Object Set E-RABToBeSetupItemBearerSUReqIEs contains no objects at line xxxx'
If it contains more than one entry then there is no problem.
E-RABSetupRequestIEs S1AP-PROTOCOL-IES ::= {
{ ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }|
{ ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }|
{ ID id-uEaggregateMaximumBitrate CRITICALITY reject TYPE UEAggregateMaximumBitrate PRESENCE optional }|
{ ID id-E-RABToBeSetupListBearerSUReq CRITICALITY reject TYPE E-RABToBeSetupListBearerSUReq PRESENCE mandatory },
...
}
diff --git a/libasn1fix/asn1fix_cws.c b/libasn1fix/asn1fix_cws.c
index d2be70d..948c627 100644
--- a/libasn1fix/asn1fix_cws.c
+++ b/libasn1fix/asn1fix_cws.c
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <stdlib.h>
#include "asn1fix_internal.h"
#include "asn1fix_cws.h"
@@ -195,6 +197,8 @@
return _asn1f_foreach_unparsed_union(ct, process, keyp);
case ACT_CA_CSV: /* , */
break;
+ case ACT_EL_VALUE:
+ return 0;
}
for(size_t i = 0; i < ct->el_count; i++) {
@@ -407,7 +411,7 @@
/* This value 100 should be larger than following formatting string */
psize = bend - buf + 100;
- pp = malloc(psize);
+ pp = calloc(1, psize);
if(pp == NULL) {
free(mivr);
return -1;