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

Base64.Encoder.wrap(os).write(byte[],int,int) with incorrect arguments should not produce output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • core-libs
    • b135

        An output stream 'es' can be obtained as encoder.wrap(os).
        Normally, es.write(buf, off, len) throws IndexOutOfBoundException, if the referenced portion lies outside the buffer. In this case, nothing is written to the underlying output stream 'os'.

        However, if (off + len) numerically overflows, then the call to write() will produce some output and only when reached the boundary of the buf will throw the exception.

        This behavior looks inconsistent.

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

                Created:
                Updated:
                Resolved: