[
https://issues.apache.org/jira/browse/ARTEMIS-5115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Justin Bertram updated ARTEMIS-5115:
------------------------------------
Description:
In the {{clearUpTo}} method packages are cleared one at a time to the specified
command ID. If the logger is enabled, information about
{{RemotingConnectionID}}, {{lastReceived}}, {{commandId}}, and other data is
displayed. In the first {{if}} the correct ternary operator is written which
checks {{connection == null}}.
Below in the loop is [another
{{if}}|[https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L874-L875]],
where there is no check for null which can lead to a {{NullPointerException}}.
[https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L856-L886]
was:
In the clearUpTo method, packages are cleared one at a time to the specified
command ID. If the logger is enabled, information about RemotingConnectionID,
lastReceived commandId and other data is displayed. In the first if
construction, the correct ternary operator is written, which checks the value
of connection == null
Below in the loop is [another if
construction|[https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L874-L875]],
where there is no connection check for null, which can lead to a
NullPointerException program error.
[https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L856-L886]
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A.Rudyuk.
> deref after NULL in ChannelImpl.java
> ------------------------------------
>
> Key: ARTEMIS-5115
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5115
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Alex
> Priority: Major
>
> In the {{clearUpTo}} method packages are cleared one at a time to the
> specified command ID. If the logger is enabled, information about
> {{RemotingConnectionID}}, {{lastReceived}}, {{commandId}}, and other data is
> displayed. In the first {{if}} the correct ternary operator is written which
> checks {{connection == null}}.
> Below in the loop is [another
> {{if}}|[https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L874-L875]],
> where there is no check for null which can lead to a
> {{NullPointerException}}.
> [https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L856-L886]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact