Jeffrey Walton <[email protected]> writes:

> Hi All,
>
> I've read the documentation on asn1_read_value at asn1_read_value. I'm
> not clear on what happens if the buffer provided to asn1_read_value is
> too small.
>
> Does (1) asn1_read_value fail, (2) does the function copy bytes up to
> size of the buffer and return truncation, or (3) copy up to size of
> the buffer and succeed?

See the 'Returns' description:

   ASN1_MEM_ERROR: The value vector isn't big enough to store the
   result. In this case LEN will contain the number of bytes needed.

The contents of the buffer is undefined at that point.

/Simon

Reply via email to