commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (IMAGING-178) PnmImageParser does not check the validity of input PAM header
Date Sun, 12 Jun 2016 14:48:21 GMT

     [ https://issues.apache.org/jira/browse/IMAGING-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Benedikt Ritter resolved IMAGING-178.
-------------------------------------
    Resolution: Fixed

{code}
$ svn ci -m "IMAGING-178: PnmImageParser does not check the validity of input PAM header.
Thanks to emopers. This also fixes #20 from github."
Sending        src/changes/changes.xml
Sending        src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java
Sending        src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
Transmitting file data ...done
Committing transaction...
Committed revision 1748015.
{code}

Thank you!

> PnmImageParser does not check the validity of input PAM header
> --------------------------------------------------------------
>
>                 Key: IMAGING-178
>                 URL: https://issues.apache.org/jira/browse/IMAGING-178
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: PNM
>            Reporter: emopers
>
> PnmImageParser.java directly calls tokenizer.nextToken() at line no 160, 163, 166, 169
and 172 on java.util.StringTokenizer tokenizer without checking if there are more tokens.
 Because tokenizer is built from the bytes string that can be invalid, this can lead to a
runtime exception without a useful error message.  This can be easily fixed by calling tokenizer.hasMoreTokens()
before calling tokenizer.nextToken() at each line number mentioned before and throwing useful
error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message