-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
6
-
None
-
generic
-
generic
In zip_util.h, macros are defined to access header fields, e.g.
#define LG(b, n) (SH(b, n) | (SH(b, n+2) << 16))
...
#define ENDSIZ(b) LG(b, 12) /* central directory size */
These are used in zip_util.c, e.g.
cenlen = ENDSIZ(endbuf);
if (cenlen > endpos)
ZIP_FORMAT_ERROR("invalid END header (bad central directory size)");
cenlen is declared as a jlong, which is signed. If the value returned from ENDSIZ has the high order bit set, cenlen is negative, and definitely less than endpos. The value of cenlen is used (indirectly) in a call to mmap, which results in
mmap failed for CEN and END part of zip file
#define LG(b, n) (SH(b, n) | (SH(b, n+2) << 16))
...
#define ENDSIZ(b) LG(b, 12) /* central directory size */
These are used in zip_util.c, e.g.
cenlen = ENDSIZ(endbuf);
if (cenlen > endpos)
ZIP_FORMAT_ERROR("invalid END header (bad central directory size)");
cenlen is declared as a jlong, which is signed. If the value returned from ENDSIZ has the high order bit set, cenlen is negative, and definitely less than endpos. The value of cenlen is used (indirectly) in a call to mmap, which results in
mmap failed for CEN and END part of zip file
- duplicates
-
JDK-4681995 Add support for large (> 4GB) zip/jar files
- Resolved