Replace the static error string in ZIP_Put_In_Cache0 with on stack memory

Alan Bateman Alan.Bateman at oracle.com
Wed Apr 18 18:05:34 UTC 2012


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.

-Alan.



More information about the core-libs-dev mailing list