This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 97a9c690ae238e805e34158e85fa9aaa0920650a
Author: aslepykh <[email protected]>
AuthorDate: Thu Feb 29 09:42:37 2024 +0300

    ARTEMIS-4695 BAD_COPY_PASTE in VersionedStompFrameHandler.java
    
    In 1st branch (line 274) of the if() statement, the
    Boolean.parseBoolean() method accepts the value
    frame.getHeader(Stomp.Headers.Subscribe.NO_LOCAL), which is used in line
    273.
    
    In 2nd branch (line 276), the Boolean.parseBoolean() method accepts the
    value frame.getHeader(Stomp.Headers.Subscribe.NO_LOCAL), although the
    other value frame.hasHeader(Stomp.Headers.Subscribe.ACTIVEMQ_NO_LOCAL)
    is used.
    
    Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
    Author A. Slepykh.
---
 .../artemis/core/protocol/stomp/VersionedStompFrameHandler.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
 
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
index bfad0794e4..b4cd5ead7b 100644
--- 
a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
+++ 
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
@@ -273,7 +273,7 @@ public abstract class VersionedStompFrameHandler {
       if (frame.hasHeader(Stomp.Headers.Subscribe.NO_LOCAL)) {
          noLocal = 
Boolean.parseBoolean(frame.getHeader(Stomp.Headers.Subscribe.NO_LOCAL));
       } else if (frame.hasHeader(Stomp.Headers.Subscribe.ACTIVEMQ_NO_LOCAL)) {
-         noLocal = 
Boolean.parseBoolean(frame.getHeader(Stomp.Headers.Subscribe.NO_LOCAL));
+         noLocal = 
Boolean.parseBoolean(frame.getHeader(Stomp.Headers.Subscribe.ACTIVEMQ_NO_LOCAL));
       }
       Integer consumerWindowSize = null;
       if (frame.hasHeader(Headers.Subscribe.CONSUMER_WINDOW_SIZE)) {

Reply via email to