Skip to content

fix(staticpool): guard outbound queue index access#1815

Open
robekl wants to merge 1 commit intomeshcore-dev:devfrom
robekl:fix/staticpool-outbound-index-bounds
Open

fix(staticpool): guard outbound queue index access#1815
robekl wants to merge 1 commit intomeshcore-dev:devfrom
robekl:fix/staticpool-outbound-index-bounds

Conversation

@robekl
Copy link

@robekl robekl commented Feb 24, 2026

Summary

Adds bounds enforcement for outbound queue indexing in static pool packet management.

Bug

PacketQueue::itemAt did not validate index bounds before dereferencing queue storage.

Trigger

Request outbound queue items with an index outside current queue range (directly or through higher-level accessors like outbound-by-index paths).

Impact

  • Out-of-bounds memory access
  • Possible crash or memory corruption
  • Nondeterministic routing/queue behavior under invalid index usage

Fix

Added explicit bounds checks in itemAt; invalid indices are rejected instead of dereferenced.

Return null for out-of-range PacketQueue::itemAt() indexes instead of indexing raw storage directly.

Prevents out-of-bounds reads when callers probe outbound entries beyond the current queue length.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant