On Tuesday 03 March 2009 05:00:59 [email protected] wrote: > Author: j16sdiz > Date: 2009-03-03 05:00:59 +0000 (Tue, 03 Mar 2009) > New Revision: 25876 > > Modified: > trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java > Log: > PNGFilter should throw DataFormatException > > It was throwing ArrayIndexOutOfBoundException and NegativeIndexException for invalid images. > > Modified: trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java > =================================================================== > --- trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java > 2009-03-03 03:12:22 UTC (rev 25875) > +++ trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java > 2009-03-03 05:00:59 UTC (rev 25876) ... > } > - if(hasSeenIEND && dis.available() > 0) > + if (hasSeenIEND && dis.available() > 0) > throwError("IEND not last chunk", "IEND not > last chunk"); > - > + > dis.close(); > + } catch (ArrayIndexOutOfBoundsException e) { > + throwError("ArrayIndexOutOfBoundsException while filtering", "ArrayIndexOutOfBoundsException while filtering"); > + } catch (NegativeArraySizeException e) { > + throwError("NegativeArraySizeException while filtering", "NegativeArraySizeException while filtering"); > + } catch (EOFException e) { > + throwError("EOF Exception while filtering", "EOF > Exception while filtering"); > } finally {
It is good to catch these, but really they shouldn't have been thrown in the first place ...
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
