You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2024/04/20 05:03:00 UTC

[jira] [Updated] (ARTEMIS-4663) Possible dereference of null in MQTTPublishManager

     [ https://issues.apache.org/jira/browse/ARTEMIS-4663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Bertram updated ARTEMIS-4663:
------------------------------------
    Component/s:     (was: ActiveMQ-Artemis-Native)

> Possible dereference of null in MQTTPublishManager
> --------------------------------------------------
>
>                 Key: ARTEMIS-4663
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4663
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.32.0
>            Reporter: Andrey Slepykh
>            Priority: Major
>              Labels: dereference-of-null
>
> Return value of a function [readNullableSimpleString|https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java#L377] is dereferenced at [MQTTPublishManager.java:378|https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java#L378] without checking for null, but it is usually checked for this function.
> Since the readNullableSimpleString() function can return a null value, it may be worth adding a null check before using it on line 378.
> The [publishToClient|https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java#L371] private function can throw exceptions, but they are not handled anywhere in the class.
> Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
> Author A. Burke.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)