projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dc2d49
)
Fix off by one error in a test.
author
Rob Landley
<rob@landley.net>
Wed, 17 Jan 2007 21:31:23 +0000
(16:31 -0500)
committer
Rob Landley
<rob@landley.net>
Wed, 17 Jan 2007 21:31:23 +0000
(16:31 -0500)
lib/bunzip.c
patch
|
blob
|
history
diff --git
a/lib/bunzip.c
b/lib/bunzip.c
index
5c3b842
..
01daa78
100644
(file)
--- a/
lib/bunzip.c
+++ b/
lib/bunzip.c
@@
-197,7
+197,9
@@
int read_bunzip_data(bunzip_data *bd)
t = get_bits(bd, 5);
for (i = 0; i < symCount; i++) {
for(;;) {
- if (MAX_HUFCODE_BITS < (unsigned)t-1) return RETVAL_DATA_ERROR;
+ // !t || t > MAX_HUFCODE_BITS in one test.
+ if (MAX_HUFCODE_BITS-1 < (unsigned)t-1)
+ return RETVAL_DATA_ERROR;
if(!get_bits(bd, 1)) break; // Stop yet?
t += (1 - 2*get_bits(bd, 1)); // bit ? t-- : t++
}