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

Incorrect position calculation in PositionedStoreStream with read(byte[],...)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4, 10.4.1.3, 10.5.1.1
    • Fix Version/s: 10.4.2.0, 10.5.1.1
    • Component/s: JDBC, Store
    • Labels:
      None

      Description

      A bug in the methods 'read(byte[])' and 'read(byte[],int,int)' in PositionedStoreStream can cause the position variable to be set to an incorrect value.
      The bug is only triggered if one of the two read methods is invoked after EOF of the underlying stream has been reached.

      If the bug is triggered, the position will be decreased by one because the underlying stream returns -1. Subsequent reads will further decrease the position. This can cause EOF-exceptions (during repositioning) or incorrect data being returned in subsequent calls.

        Attachments

        1. derby-3735-2a.diff
          0.8 kB
          Kristian Waagan
        2. derby-3735-1b.diff
          12 kB
          Kristian Waagan
        3. derby-3735-1a.stat
          0.3 kB
          Kristian Waagan
        4. derby-3735-1a.diff
          12 kB
          Kristian Waagan

          Activity

            People

            • Assignee:
              kristwaa Kristian Waagan
              Reporter:
              kristwaa Kristian Waagan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: