mirror of https://gerrit.osmocom.org/asn1c
proper reacting on nested indefinite length containers
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1017 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
parent
17af7cc374
commit
a4ee0b50a7
|
@ -19,6 +19,8 @@ cat<<EOM > $ORIG
|
|||
<P O="24" T="[UNIVERSAL 2]" TL="2" V="4" A="INTEGER">1¦ G</P>
|
||||
</C O="30" T="[UNIVERSAL 16]" A="SEQUENCE" L="8">
|
||||
</C O="30" T="[UNIVERSAL 16]" A="SEQUENCE" L="24">
|
||||
<I O="30" T="[UNIVERSAL 16]" TL="2" V="Indefinite" A="SEQUENCE">
|
||||
</I O="32" T="[UNIVERSAL 0]" TL="2" L="4">
|
||||
EOM
|
||||
|
||||
./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1
|
||||
|
@ -31,7 +33,7 @@ if [ "$diffExitCode" = "0" ]; then
|
|||
fi
|
||||
|
||||
# Append necessary terminator
|
||||
echo '</I O="30" T="[UNIVERSAL 0]" TL="2" L="32">' >> $ORIG
|
||||
echo '</I O="34" T="[UNIVERSAL 0]" TL="2" L="36">' >> $ORIG
|
||||
|
||||
# Try trancoding again
|
||||
./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1
|
||||
|
|
|
@ -322,9 +322,10 @@ process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level,
|
|||
effective_size += t_len + l_len;
|
||||
local_esize += t_len + l_len;
|
||||
|
||||
if(expect_eoc && tagbuf[0] == '\0' && tagbuf[1] == '\0') {
|
||||
if(expect_eoc && !tagbuf[0] && !tagbuf[1]) {
|
||||
/* End of content octets */
|
||||
print_TL(1, *offset - 2, level - 1, 1, 2, 0, -1, effective_size);
|
||||
print_TL(1, *offset - 2, level - 1, 1, 2, 0, -1,
|
||||
effective_size);
|
||||
return PD_FINISHED;
|
||||
}
|
||||
|
||||
|
@ -350,7 +351,8 @@ process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level,
|
|||
local_esize += dec;
|
||||
if(tlv_len == -1) {
|
||||
tblen = 0;
|
||||
if(pdc == PD_FINISHED && limit < 0)
|
||||
if(pdc == PD_FINISHED
|
||||
&& limit < 0 && !expect_eoc)
|
||||
return pdc;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue