Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-4734

Null dereferencing in ReplicationManager.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.34.0
    • None
    • None

    Description

      repliToken can be 0.

      In org.apache.activemq.artemis.core.replication.ReplicationManager#sendReplicatePacket(org.apache.activemq.artemis.core.protocol.core.Packet, boolean, org.apache.activemq.artemis.utils.ReusableLatch) the repliToken is initialized with the value returned by (line 464) OperationContextImpl.getContext(ioExecutorFactory), i.e.:

      final OperationContext repliToken = OperationContextImpl.getContext(ioExecutorFactory);

      Inside this method, a call is made to OperationContextImpl.threadLocalContext.get()(line 61), which returns the value from the thread that was set earlier. If no value was set in the stream, then token will be null.

      OperationContext token = OperationContextImpl.threadLocalContext.get();

      If ioExecutorFactory is null and there is no value set in the thread, then the repliToken will remain null because the backing getContext() method also returns null in this case.

      So repliToken can be 0 if ioExecutorFactory is null and there is no value set in the thread.

       

       

      Attachments

        Issue Links

          Activity

            People

              jbertram Justin Bertram
              galkinaa2 Galkin Alexey
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m