RFR JDK-8146431:j.u.z.ZipFile.getEntry("") throws AIOOBE

Xueming Shen xueming.shen at oracle.com
Tue Jan 5 00:29:22 UTC 2016

On 01/04/2016 02:54 PM, Martin Buchholz wrote:
> ZipFile/Assortment already tests empty entry names.  Why didn't that
> test catch any error?  IOW, ;how can ZipFile/Assortment be improved?

The bug only occurs if there is no such empty name entry inside the target zip file.
The ZipFile/Assortment probably would be the better place to put test. Did not pay
attention to the old tests.


> On Mon, Jan 4, 2016 at 1:02 PM, Xueming Shen<xueming.shen at oracle.com>  wrote:
>> Hi, please help review the change for JDK-8146431
>> Issue: https://bugs.openjdk.java.net/browse/JDK-8146431
>> webrev: http://cr.openjdk.java.net/~sherman/8146431
>> Cause:
>> The parameter "ulen" in native version zip_util.c.ZIP_GetEntry() serves two
>> purposes, (1) the length of the name (2) whether or not to try adding a
>> slash if first try failed. It has an explicit check as
>>          /* If no real length was passed in, we are done */
>>          if (ulen == 0) {
>>              break;
>>          }
>> The new java implementation uses and checks the flag "addSlash", but it
>> still needs to check the "name.len" before adding any slash for next try.
>> Thanks,
>> Sherman

More information about the core-libs-dev mailing list