Open aziz-marashly opened 1 week ago
I found here that it could be possible as a use-case, as mentioned here in this comment: https://sourceforge.net/p/asn1c/discussion/357921/thread/31c6b188/
MyTest ::= SEQUENCE {
a INTEGER,
b INTEGER,
…,
c INTEGER OPTIONAL
…
}
I have been using this decoder for around three years. I encountered an error when decoding some files and assumed they were corrupted. However, after a long debugging session, I was able to abstract and detect the leading cause of the failure.
Description: I encountered a decoding error while using an ASN.1 decoder for elements defined with indefinite length that included an extension marker (...). This error appears specifically when decoding elements labeled with application-specific tags.
Steps to Reproduce:
This is an example asn1 definition and test code to reproduce
Output:
If we change the ANS1 specs and move the
...
indicator to the end of the element, then everything will be fine. This example will work without any exceptionsExpected output:
Is this a bug in the decoder's handling of indefinite-length elements with extension markers, or is the ASN.1 specification incorrectly interpreted by the decoder, or is the ASN.1 specification incorrect?
Context:
Thank you