[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: |
Andreas Schneider |
Subject: |
Re: [BUG] asn1_read_value_type() with len = 0 fails for CHOICE and BIT STRING |
Date: |
Tue, 25 Oct 2016 12:56:14 +0200 |
User-agent: |
KMail/5.3.2 (Linux/4.8.3-1-default; KDE/5.26.0; x86_64; ; ) |
On Monday, 24 October 2016 18:52:51 CEST Nikos Mavrogiannopoulos wrote:
> 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.
I fixed the test case to have:
if (result != ASN1_SUCCESS && len == 0)
and this works, however I think I found my issue ... damn :)
--
Andreas Schneider GPG-ID: CC014E3D
Samba Team address@hidden
www.samba.org