You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bifromq.apache.org by "pallavithegod (via GitHub)" <gi...@apache.org> on 2026/10/14 16:00:02 UTC
[PR] Fix TopicUtil accepting shared subscription with empty filter [bifromq]
pallavithegod opened a new pull request, #317:
URL: https://github.com/apache/bifromq/pull/317
## Summary
Reject `$share/g/` and `$oshare/g/` where the filter part is empty.
Previously `TopicUtil.isValidTopicFilter` returned `true` for these inputs because after skipping the share-name separator, `i` was advanced to `topicFilter.length()` and the main scan loop was skipped entirely.
## Fix
Add explicit empty-filter guard after skipping the separator, per MQTT-4.8.2-2.
Fixes #288
## Verification
- Updated `TopicUtilsTest`: `$share/g/` now asserts false, added `$oshare/g/` coverage. `$share/g//` remains true.
- `TopicUtilsTest`: 7 tests run, 0 failures.
--
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@bifromq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org