RockteMQ-AI commented on issue #2741:
URL:
https://github.com/apache/rocketmq-dashboard/issues/2741#issuecomment-5460246060
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
The issue describes a valid parsing deficiency in `NamesrvAddrParser`:
1. **Trailing empty segments**: `String.split(",")` without a negative limit
parameter silently discards trailing empty strings, so `ns1:9876,` is accepted
while interior empties like `ns1:9876,,ns2:9876` are rejected — inconsistent
behavior.
2. **IPv6 validation**: The bracket check only verifies the presence of `[`
and `]` characters but does not validate the actual IPv6 structure, allowing
malformed literals like `[1:2:3]:9876` or `[1::2::3]:9876`.
**Suggested fix:**
- Use `split(",", -1)` to retain trailing empty segments and reject them
uniformly.
- Parse bracketed hosts with `Inet6Address` validation or a proper IPv6
regex to reject structurally invalid literals.
**Severity:** Medium — malformed addresses could cause silent connection
failures or unexpected routing.
---
*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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]