Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1396

ReEncodedInputStream may fail to read all of source Reader.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.1.6
    • 10.2.1.6
    • Network Server
    • None

    Description

      The class org.apache.derby.impl.drda.ReEncodedInputStream seems to have a bug...

      In this class, there exists next code.

      int count;
      if(( count = reader.read(decodedBuffer_, 0, BUFFERED_CHAR_LEN )) < 1 )

      { return null; }

      In this code, the condition of "<1" was intended to judge whether reader was read entirely.
      However,spec of java api says that reader returns -1 if the end of the reader has been reached and not 0.
      Then "<1" is not appropriate.

      Current code judges 0 as the end of reader.
      Then, if 0 was returned in the meaning that "No character was read now but may continue" as possible in java api,
      this code will not work correctly...

      Attachments

        1. DERBY-1396.patch
          0.7 kB
          Tomohito Nakayama

        Activity

          People

            tmnk Tomohito Nakayama
            tmnk Tomohito Nakayama
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: