Commit 567e5631 authored by Martin Pool's avatar Martin Pool

Merge zlib double-free bug forwarded by Mark J Cox.

parent 9e95e92b
......@@ -249,10 +249,12 @@ int r;
&s->sub.trees.tb, s->hufts, z);
if (t != Z_OK)
{
ZFREE(z, s->sub.trees.blens);
r = t;
if (r == Z_DATA_ERROR)
s->mode = zBAD;
{
ZFREE(z, s->sub.trees.blens);
s->mode = zBAD;
}
LEAVE
}
s->sub.trees.index = 0;
......@@ -317,10 +319,14 @@ int r;
if (t != Z_OK)
{
if (t == (uInt)Z_DATA_ERROR)
s->mode = zBAD;
{
ZFREE(z, s->sub.trees.blens);
s->mode = zBAD;
}
r = t;
LEAVE
}
ZFREE(z, s->sub.trees.blens);
Tracev((stderr, "inflate: trees ok\n"));
if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment