Skip to content
Snippets Groups Projects
Commit 6b4e787d authored by Rene Brun's avatar Rene Brun
Browse files

Protection proposed by Mathieu de Naurois in case of an overwritten buffer.

Without this protection the program crashes. With the protection,
the error is recovered by TBasket::ReadBasketBuffers.


git-svn-id: http://root.cern.ch/svn/root/trunk@8589 27541ba8-7e3a-0410-8455-c3a389f83636
parent 1751ed3a
Branches
Tags
Loading
/* @(#)root/zip:$Name: $:$Id: Inflate.c,v 1.10 2004/03/17 17:34:01 brun Exp $ */ /* @(#)root/zip:$Name: $:$Id: ZInflate.c,v 1.1 2004/03/17 19:10:20 brun Exp $ */
/* Author: */ /* Author: */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -578,16 +578,13 @@ int R__huft_build(unsigned *b, unsigned n, unsigned s, ush *d, ush *e, struct hu ...@@ -578,16 +578,13 @@ int R__huft_build(unsigned *b, unsigned n, unsigned s, ush *d, ush *e, struct hu
r.b = (uch)(k - w); r.b = (uch)(k - w);
if (p >= v + n) if (p >= v + n)
r.e = 99; /* out of values--invalid code */ r.e = 99; /* out of values--invalid code */
else if (*p < s) else if (*p < s) {
{
r.e = (uch)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */ r.e = (uch)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */
r.v.n = *p++; /* simple code is just the value */ r.v.n = *p++; /* simple code is just the value */
} } else if(e && d) {
else
{
r.e = (uch)e[*p - s]; /* non-simple--look up in lists */ r.e = (uch)e[*p - s]; /* non-simple--look up in lists */
r.v.n = d[*p++ - s]; r.v.n = d[*p++ - s];
} } else return 1;
/* fill code-like entries with r */ /* fill code-like entries with r */
f = 1 << (k - w); f = 1 << (k - w);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment