7118283: Better input parameter checking in zip file processing

Fixed off-by-one bug in zip_util.c

Reviewed-by: alanb
This commit is contained in:
Xueming Shen 2011-12-15 14:18:56 -08:00
parent 53ea54c90f
commit 8514873d3d

View File

@ -521,7 +521,7 @@ countCENHeaders(unsigned char *beg, unsigned char *end)
{
jint count = 0;
ptrdiff_t i;
for (i = 0; i + CENHDR < end - beg; i += CENSIZE(beg + i))
for (i = 0; i + CENHDR <= end - beg; i += CENSIZE(beg + i))
count++;
return count;
}