A malformed compressed integer would cause unzck to read one byte past the
end of the allocated memory. This commit fixes this bug. Thanks to
Agostino Sarubbo of Gentoo for providing a bug report with a reproducible
test case.
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
break;
i++;
/* Make sure we're not overflowing and fail if we do */
- if(count > MAX_COMP_SIZE || count > max_length || *val < old_val) {
+ if(count >= MAX_COMP_SIZE || count >= max_length || *val < old_val) {
if(count > max_length)
set_fatal_error(zck, "Read past end of header");
else