[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] asn1_read_value_type() with len = 0 fails for CHOICE and BIT S
From: |
Nikos Mavrogiannopoulos |
Subject: |
Re: [BUG] asn1_read_value_type() with len = 0 fails for CHOICE and BIT STRING |
Date: |
Mon, 24 Oct 2016 18:52:51 +0200 |
On Mon, 2016-10-24 at 14:28 +0200, Andreas Schneider wrote:
> Hello,
>
> asn1_read_value_type() with len = 0 passed fails for CHOICE and BIT
> STRINGĀ
> types.
> See the attached patch which adds a testcase!
This function is documented to return "%ASN1_MEM_ERROR if The value
vector isn't big enough to store the result, and in this case @len will
contain the number of bytes needed.". That seems to be the case in your
example (even though the output is NULL, ASN1_MEM_ERROR is still
returned). Note that it can also return %ASN1_SUCCESS when provided
with NULL value and zero length, if the actual data are zero.
The attached patch should fix your test case.
regards,
Nikos
patch.txt
Description: Text document