You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yuluo-yx (via GitHub)" <gi...@apache.org> on 2026/08/08 06:32:49 UTC

[I] MQVersion throws ArrayIndexOutOfBoundsException for negative version values [rocketmq]

yuluo-yx opened a new issue, #10829:
URL: https://github.com/apache/rocketmq/issues/10829

   MQVersion.getVersionDesc and value2Version clamp values above the known range, but negative values index the version array directly and throw ArrayIndexOutOfBoundsException. Version values originate from remote client metadata, so malformed or unknown negative values should be handled without crashing callers. Expected behavior: clamp negative values to the earliest known version, consistently with the existing upper-bound handling.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] MQVersion throws ArrayIndexOutOfBoundsException for negative version values [rocketmq]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10829:
URL: https://github.com/apache/rocketmq/issues/10829#issuecomment-5225050329

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase (`develop` branch).
   
   **Root Cause:** `MQVersion.getVersionDesc(int)` and `MQVersion.value2Version(int)` check `if (value >= length)` but do not guard against negative values. A negative `value` causes `ArrayIndexOutOfBoundsException` when accessing `versions[value]`.
   
   **Impact:** Any code path passing a negative version number (e.g., from corrupted data or protocol error) crashes instead of returning a safe default.
   
   **Severity:** low
   
   **Affected code:** `common/src/main/java/org/apache/rocketmq/common/MQVersion.java`
   
   An automated fix proposal will be generated. Reply `/approve` to proceed with PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org