7118283: Better input parameter checking in zip file processing
authorsherman
Thu, 15 Dec 2011 14:18:56 -0800
changeset 11898 5621097881f1
parent 11897 9e80dbac0293
child 11899 d2eb55fd95a1
7118283: Better input parameter checking in zip file processing Summary: Fixed off-by-one bug in zip_util.c Reviewed-by: alanb
jdk/src/share/native/java/util/zip/zip_util.c
--- a/jdk/src/share/native/java/util/zip/zip_util.c	Wed Dec 14 14:43:44 2011 +0400
+++ b/jdk/src/share/native/java/util/zip/zip_util.c	Thu Dec 15 14:18:56 2011 -0800
@@ -521,7 +521,7 @@
 {
     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;
 }