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

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

XMLWordPrintable

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

                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.

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

                Created:
                Updated:
                Resolved: