mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
[PATCH] Update in-kernel zlib routines
These bugs have been fixed in the standard zlib for a while. See for example a) http://sources.redhat.com/ml/bug-gnu-utils/1999-06/msg00183.html b) http://bugs.gentoo.org/show_bug.cgi?id=94584 Signed-off-by: Tim Yamin <plasmaroo@gentoo.org> Signed-off-by: Tavis Ormandy <taviso@gentoo.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
00a5dfdb93
commit
4aad724d3e
@ -1307,7 +1307,7 @@ local int huft_build(
|
|||||||
{
|
{
|
||||||
*t = (inflate_huft *)Z_NULL;
|
*t = (inflate_huft *)Z_NULL;
|
||||||
*m = 0;
|
*m = 0;
|
||||||
return Z_OK;
|
return Z_DATA_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1351,6 +1351,7 @@ local int huft_build(
|
|||||||
if ((j = *p++) != 0)
|
if ((j = *p++) != 0)
|
||||||
v[x[j]++] = i;
|
v[x[j]++] = i;
|
||||||
} while (++i < n);
|
} while (++i < n);
|
||||||
|
n = x[g]; /* set n to length of v */
|
||||||
|
|
||||||
|
|
||||||
/* Generate the Huffman codes and for each, make the table entries */
|
/* Generate the Huffman codes and for each, make the table entries */
|
||||||
|
@ -326,7 +326,7 @@ DEBG("huft1 ");
|
|||||||
{
|
{
|
||||||
*t = (struct huft *)NULL;
|
*t = (struct huft *)NULL;
|
||||||
*m = 0;
|
*m = 0;
|
||||||
return 0;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBG("huft2 ");
|
DEBG("huft2 ");
|
||||||
@ -374,6 +374,7 @@ DEBG("huft5 ");
|
|||||||
if ((j = *p++) != 0)
|
if ((j = *p++) != 0)
|
||||||
v[x[j]++] = i;
|
v[x[j]++] = i;
|
||||||
} while (++i < n);
|
} while (++i < n);
|
||||||
|
n = x[g]; /* set n to length of v */
|
||||||
|
|
||||||
DEBG("h6 ");
|
DEBG("h6 ");
|
||||||
|
|
||||||
@ -410,12 +411,13 @@ DEBG1("1 ");
|
|||||||
DEBG1("2 ");
|
DEBG1("2 ");
|
||||||
f -= a + 1; /* deduct codes from patterns left */
|
f -= a + 1; /* deduct codes from patterns left */
|
||||||
xp = c + k;
|
xp = c + k;
|
||||||
while (++j < z) /* try smaller tables up to z bits */
|
if (j < z)
|
||||||
{
|
while (++j < z) /* try smaller tables up to z bits */
|
||||||
if ((f <<= 1) <= *++xp)
|
{
|
||||||
break; /* enough codes to use up j bits */
|
if ((f <<= 1) <= *++xp)
|
||||||
f -= *xp; /* else deduct codes from patterns */
|
break; /* enough codes to use up j bits */
|
||||||
}
|
f -= *xp; /* else deduct codes from patterns */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DEBG1("3 ");
|
DEBG1("3 ");
|
||||||
z = 1 << j; /* table entries for j-bit table */
|
z = 1 << j; /* table entries for j-bit table */
|
||||||
|
@ -141,7 +141,7 @@ static int huft_build(
|
|||||||
{
|
{
|
||||||
*t = NULL;
|
*t = NULL;
|
||||||
*m = 0;
|
*m = 0;
|
||||||
return Z_OK;
|
return Z_DATA_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user