7118283: Better input parameter checking in zip file processing
authorasaha
Tue Dec 13 17:40:39 2011 -0800 (17 months ago)
changeset 55271ca2b40fdc9
parent 551ee0f12b18cb8
child 553bfaa99d5bef8
7118283: Better input parameter checking in zip file processing
Reviewed-by: sherman
src/share/native/java/util/zip/zip_util.c
--- a/src/share/native/java/util/zip/zip_util.c Wed Nov 30 22:10:30 2011 +0000
+++ b/src/share/native/java/util/zip/zip_util.c Tue Dec 13 17:40:39 2011 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -450,7 +450,7 @@ countCENHeaders(unsigned char *beg, unsi
{
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;
}