Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-4664

CompressedCollection silently allows add() after closeForWrite()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: EJBCA 6.5.0
    • Component/s: None
    • Labels:
      None

      Description

      It is possible to invoke add() operation after closeForWrite() operation which can be invoked with every iterator call. This add() call would silently "fail" and increment size of collection by one. That means that all unit tests will fail to detect an issue just by checking its size.

      TODO: Check the usage of the class. Make sure there were no add() calls after closeForWrite() or any iterating through collection. Remember to check for "for loops" as well because those will invoke iterator().

      Possible fix: throw an exception with every add() call after closeForWrite() is invoked

      Attached: Main.java that reproduces the problem

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              johan Johan Eklund
              Reporter:
              marko Marko Prvulovic (Inactive)
              Verified by:
              Mike Agrenius Kushner
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: