projects
/
debian
/
gzip
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix some lintian whining
[debian/gzip]
/
unpack.c
diff --git
a/unpack.c
b/unpack.c
index 477e4ac86a1448d3f08ff4c23d0dc30b55689e75..56cc98c5ad5c36d004a98fc9fdbbaf373bb4003f 100644
(file)
--- a/
unpack.c
+++ b/
unpack.c
@@
-1,6
+1,6
@@
/* unpack.c -- decompress files in pack format.
/* unpack.c -- decompress files in pack format.
- Copyright (C) 1997, 1999, 2006, 2009-201
6
Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2006, 2009-201
8
Free Software Foundation, Inc.
Copyright (C) 1992-1993 Jean-loup Gailly
This program is free software; you can redistribute it and/or modify
Copyright (C) 1992-1993 Jean-loup Gailly
This program is free software; you can redistribute it and/or modify
@@
-186,6
+186,9
@@
local void build_tree()
/* Restore nodes to be parents+leaves: */
nodes += leaves[len];
}
/* Restore nodes to be parents+leaves: */
nodes += leaves[len];
}
+ if ((nodes >> 1) != 1)
+ gzip_error ("too few leaves in Huffman tree");
+
/* Construct the prefix table, from shortest leaves to longest ones.
* The shortest code is all ones, so we start at the end of the table.
*/
/* Construct the prefix table, from shortest leaves to longest ones.
* The shortest code is all ones, so we start at the end of the table.
*/
@@
-250,10
+253,8
@@
int unpack(in, out)
}
}
/* At this point, peek is the next complete code, of len bits */
}
}
/* At this point, peek is the next complete code, of len bits */
- if (peek == eob)
+ if (peek == eob
&& len == max_len
)
break; /* End of file. */
break; /* End of file. */
- if (eob < peek)
- gzip_error ("invalid compressed data--code out of range");
put_ubyte(literal[peek+lit_base[len]]);
Tracev((stderr,"%02d %04x %c\n", len, peek,
literal[peek+lit_base[len]]));
put_ubyte(literal[peek+lit_base[len]]);
Tracev((stderr,"%02d %04x %c\n", len, peek,
literal[peek+lit_base[len]]));