Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8074954

ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF

    XMLWordPrintable

    Details

      Backports

        Description

        The readShort and readInt methods call:

        if (read(byteBuf, 0, 2) < 0) {
           throw new EOFException();
        }

        and

        if (read(byteBuf, 0, 4) < 0) {
           throw new EOFException();
        }

        respectively. However, for readShort, if only a single byte is left, or for
        readInt, if less than 4 bytes are left, the code that follows will use
        incorrect values from the byteBuf array.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                bae Andrew Brygin
                Reporter:
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: