aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1fix
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2017-09-07 02:05:28 -0700
committerLev Walkin <vlm@lionet.info>2017-09-07 02:05:28 -0700
commitbe518fac4cac4ae912edc7e99c884354fb31ccb0 (patch)
tree2cd03a88281f8b61594e102fa9c994737752ae1e /libasn1fix
parent154519a3a7597242775fea24f64b31bbfe454d0e (diff)
ENUMERATION can not be empty
Diffstat (limited to 'libasn1fix')
-rw-r--r--libasn1fix/asn1fix_bitstring.c9
-rw-r--r--libasn1fix/asn1fix_cws.c3
2 files changed, 7 insertions, 5 deletions
diff --git a/libasn1fix/asn1fix_bitstring.c b/libasn1fix/asn1fix_bitstring.c
index d67ca01d..3e196f69 100644
--- a/libasn1fix/asn1fix_bitstring.c
+++ b/libasn1fix/asn1fix_bitstring.c
@@ -174,21 +174,22 @@ asn1f_BS_unparsed_convert(arg_t *arg, asn1p_value_t *value, asn1p_expr_t *ttype)
assert(value->type == ATV_UNPARSED);
- psize = value->value.string.size + 64;
+ psize = value->value.string.size + sizeof("M DEFINITIONS ::= BEGIN V ::= BIT STRING END") + 32;
p = malloc(psize);
if(p == NULL)
return -1;
ret = snprintf(p, psize,
"M DEFINITIONS ::=\nBEGIN\n"
- "V ::= INTEGER %s\n"
+ "V ::= #BIT STRING %s\n"
"END\n",
value->value.string.buf
);
assert(ret < psize);
psize = ret;
- asn = asn1p_parse_buffer(p, psize, A1P_NOFLAGS);
+ asn = asn1p_parse_buffer(p, psize, arg->expr->module->source_file_name,
+ arg->expr->_lineno, A1P_EXTENDED_VALUES);
free(p);
if(asn == NULL) {
FATAL("Cannot parse BIT STRING value %s "
@@ -205,7 +206,6 @@ asn1f_BS_unparsed_convert(arg_t *arg, asn1p_value_t *value, asn1p_expr_t *ttype)
V = TQ_FIRST(&(mod->members));
assert(V);
assert(strcmp(V->Identifier, "V") == 0);
- assert(TQ_FIRST(&(V->members)));
/*
* Simple loop just to fetch the maximal bit position
@@ -250,6 +250,7 @@ asn1f_BS_unparsed_convert(arg_t *arg, asn1p_value_t *value, asn1p_expr_t *ttype)
bit->Identifier, bit->_lineno);
RET2RVAL(1, r_value);
}
+ fprintf(stderr, "Referencing bit %s\n", bit->Identifier);
bitdef = asn1f_lookup_child(ttype, bit->Identifier);
if(bitdef == NULL) {
FATAL("Identifier \"%s\" at line %d is not defined "
diff --git a/libasn1fix/asn1fix_cws.c b/libasn1fix/asn1fix_cws.c
index 1106e555..035ccf7a 100644
--- a/libasn1fix/asn1fix_cws.c
+++ b/libasn1fix/asn1fix_cws.c
@@ -443,7 +443,8 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_cell_s *cell,
assert(ret < psize);
psize = ret;
- asn = asn1p_parse_buffer(pp, psize, A1P_NOFLAGS);
+ asn = asn1p_parse_buffer(pp, psize,
+ arg->expr->module->source_file_name, arg->expr->_lineno, A1P_NOFLAGS);
free(pp);
if(asn == NULL) {
FATAL("Cannot parse Setting token %s "