Replace the static error string in ZIP_Put_In_Cache0 with on stack memory
David Holmes
david.holmes at oracle.com
Thu Apr 19 00:53:20 UTC 2012
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.
More information about the core-libs-dev
mailing list