[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libtasn1 with a fine-toothed comb
From: |
Pascal Cuoq |
Subject: |
Re: libtasn1 with a fine-toothed comb |
Date: |
Mon, 4 Apr 2016 10:52:08 +0000 |
On 04 Apr 2016, at 10:40, Pascal Cuoq <address@hidden> wrote:
>
> Ok. In any case, since we are looking at it, this use of realloc() in
> _asn1_append_value() has a memory leak.
The commit below fixes other uses of realloc() in the library:
https://github.com/pascal-cuoq/libtasn1-fork/commit/1b6070dd092a58487719355a71d48ab5e5f03401
The change in lib/decoding.c is the classic transformation. The change in
src/asn1Decoding.c takes a shortcut since the comment and logic indicate that
this realloc() call is only ever used to reduce the size of the block, never to
enlarge it (also making it unlikely that realloc() would fail, but there is no
guarantee there).
Pascal