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

Integer overflow in StringBufferInputStream.read() and CharArrayReader.read/skip()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 9
    • 9
    • core-libs
    • b132
    • Verified

    Backports

      Description

                if (pos + len > count) {
                    len = count - pos;
                }

        Here len can be close to Integer.MAX_VALUE and pos > 0, which can result in negative (pos + len).

        As a result, read() throws inappropriate StringIndexOutOfBoundsException.

        Attachments

          Issue Links

            Activity

              People

                igerasim Ivan Gerasimov
                igerasim Ivan Gerasimov
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: