Replace the static error string in ZIP_Put_In_Cache0 with on stack memory

Charles Lee littlee at linux.vnet.ibm.com
Fri Apr 20 09:06:53 UTC 2012


On 04/19/2012 04:05 PM, Sean Chou wrote:
> Thanks David and Alan, shall I find some one to commit it ?
>
>
> On Thu, Apr 19, 2012 at 8:53 AM, David Holmes<david.holmes at oracle.com>wrote:
>
>> On 19/04/2012 4:05 AM, Alan Bateman wrote:
>>
>>> On 18/04/2012 14:02, David Holmes wrote:
>>>
>>>> On 18/04/2012 10:23 PM, Sean Chou wrote:
>>>>
>>>>> Hi David, Alan,
>>>>>
>>>>> So is the patch acceptable ?
>>>>>
>>>> There is still the matter of the unexpected NULL if strdup fails. I'd
>>>> need to see the clients for this code to see how they handle failure.
>>>> My concern is the case where the caller sees a NULL return which
>>>> indicates an error, and so accesses the msg and now potentially hits
>>>> another NULL. It's unlikely but ...
>>>>
>>> I looked through the usages and nothing obvious jumps out. HotSpot will
>>> invoke ZIP_Open and that now returns a fixed string in the event of a
>>> failure. The library code opens the zip file directly and then uses
>>> ZIP_Put_In_Cache0 which seems to be handling this case.
>>>
>> Yes looks like we only have two bits of client code here and ZipFile.c
>> checks for NULL.
>>
>> Ok.
>>
>> David
>> -----
>>
>>   -Alan.
>
Hi Sean,

The patch is committed @

Changeset: c3905c1f5da7
Author:    zhouyx
Date:      2012-04-20 16:11 +0800
URL:http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c3905c1f5da7

7159982: ZipFile uses static for error message when malformed zip file encountered
Reviewed-by: alanb, dholmes


Thank you all for reviewing this.

-- 
Yours Charles




More information about the core-libs-dev mailing list