mirror of
https://github.com/opnsense/src.git
synced 2026-04-05 01:15:30 -04:00
Error handling fixes for inflate.
This commit is contained in:
parent
9e9c4443f6
commit
efec00ac60
2 changed files with 14 additions and 8 deletions
|
|
@ -252,10 +252,11 @@ 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)
|
||||
if (r == Z_DATA_ERROR) {
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
s->mode = BAD;
|
||||
}
|
||||
LEAVE
|
||||
}
|
||||
s->sub.trees.index = 0;
|
||||
|
|
@ -316,11 +317,12 @@ int r;
|
|||
t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
|
||||
s->sub.trees.blens, &bl, &bd, &tl, &td,
|
||||
s->hufts, z);
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
if (t != Z_OK)
|
||||
{
|
||||
if (t == (uInt)Z_DATA_ERROR)
|
||||
if (t == (uInt)Z_DATA_ERROR) {
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
s->mode = BAD;
|
||||
}
|
||||
r = t;
|
||||
LEAVE
|
||||
}
|
||||
|
|
@ -332,6 +334,7 @@ int r;
|
|||
}
|
||||
s->sub.decode.codes = c;
|
||||
}
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
s->mode = CODES;
|
||||
case CODES:
|
||||
UPDATE
|
||||
|
|
|
|||
|
|
@ -3864,10 +3864,11 @@ int r;
|
|||
&s->sub.trees.tb, z);
|
||||
if (t != Z_OK)
|
||||
{
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
r = t;
|
||||
if (r == Z_DATA_ERROR)
|
||||
if (r == Z_DATA_ERROR) {
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
s->mode = BADB;
|
||||
}
|
||||
LEAVE
|
||||
}
|
||||
s->sub.trees.index = 0;
|
||||
|
|
@ -3932,11 +3933,12 @@ int r;
|
|||
#endif
|
||||
t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
|
||||
s->sub.trees.blens, &bl, &bd, &tl, &td, z);
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
if (t != Z_OK)
|
||||
{
|
||||
if (t == (uInt)Z_DATA_ERROR)
|
||||
if (t == (uInt)Z_DATA_ERROR) {
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
s->mode = BADB;
|
||||
}
|
||||
r = t;
|
||||
LEAVE
|
||||
}
|
||||
|
|
@ -3953,6 +3955,7 @@ int r;
|
|||
s->sub.decode.tl = tl;
|
||||
s->sub.decode.td = td;
|
||||
}
|
||||
ZFREE(z, s->sub.trees.blens);
|
||||
s->mode = CODES;
|
||||
case CODES:
|
||||
UPDATE
|
||||
|
|
|
|||
Loading…
Reference in a new issue