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 [email protected] www.samba.org
