Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-683

CircularBufferInputStream.read() fails to convert byte to unsigned int

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

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

      Description

      The method int CircularBufferInputStream.read() returns CircularByteBuffer.read() which a byte.

      However it does not convert it to an unsigned byte, so byte values outside the range 0-127 will be sign-extended to a negative value.

      This is wrong, and can result in premature EOF.

      Note: this bug was reported by Sonarlint.
      Spotbugs does not appear to detect the bug.

        Attachments

          Activity

            People

            • Assignee:
              sebb Sebb
              Reporter:
              sebb Sebb

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment