Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-178

PnmImageParser does not check the validity of input PAM header

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-alpha1
    • Format: PNM
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            emopers emopers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: