[U-Boot] [PATCH] LZMA: Avoid free on null pointer.
Mike Frysinger
vapier at gentoo.org
Mon Dec 6 08:15:36 CET 2010
On Sunday, December 05, 2010 04:18:44 Luigi 'Comio' Mantellini wrote:
> On structure Initialization, LZMA code tries to free the dictionary
> and probs buffers, also when these are null pointers. Add some
> check in order to prevent the free on null pointers.
your patch only checks p->probs, not any dictionary buffer. if you follow the
code path:
...
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
{
alloc->Free(alloc, p->probs);
p->probs = 0;
}
...
g_Alloc.Free = SzFree;
...
static void SzFree(void *p, void *address) { p = p; free(address); }
...
this only ends up doing free(p->probs) which is free(NULL) which isnt a bug.
so you're going to need to provide some more details.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101206/90633527/attachment.pgp
More information about the U-Boot
mailing list