Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-130

ZipArchiveInputStream.skip could use safer comparison; inherited Javadoc is incorrect

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      ZipArchiveInputStream.skip uses the condition (skipped != value) to detect when it has skipped enough.
      It would be safer to use (skipped < value) in case skipped somehow exceeds value.

      Also, the inherited Javadoc says that skip(value) may skip fewer than value bytes - AFAICT this is precisely the potential error that this method was written to solve.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: