Replace the static error string in ZIP_Put_In_Cache0 with on stack memory

Alan Bateman Alan.Bateman at oracle.com
Mon Apr 9 10:01:05 UTC 2012


On 09/04/2012 08:53, Sean Chou wrote:
> Hi all,
>
>      I would like to suggest to replace the static error string in
> ZIP_Put_In_Cache0 with on stack memory.
>
> :
>
>
>      The modification is here:
> http://cr.openjdk.java.net/~zhouyx/OJDK-482/webrev.00/  .
>
Good catch, this one had probably been there for a long time but doesn't 
seem to have been noticed (perhaps because it should be rare for 2+ 
threads to attempt to open malformed zip files at around the same time).

The changes in the webrev look okay to me. Minor nit in zip_util.c at 
L847 where there should be a space in "if(". In ZipFile.c then another 
choice would be to add the free after ThrowZipException(env,msg). Where 
you have it is okay too but probably should be split over two lines to 
be consistent.

I assume that Neil or Charles will push this for you. I've created a bug 
for it:
7159982: ZipFile uses static for error message when malformed zip file 
encountered

Regards,
Alan.



More information about the core-libs-dev mailing list