Skip to content

utils: compare MetricsBatch str_data indexes without narrowing to int - #1946

Merged
boks1971 merged 1 commit into
mainfrom
raja/metrics-batch-index
Nov 5, 2026
Merged

boks1971 merged 1 commit into
mainfrom
raja/metrics-batch-index

Conversation

@boks1971

@boks1971 boks1971 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

MetricsBatchBuilder.Merge checks each wire str_data index against len(str_data) after converting the uint32 index to int. On 32-bit builds an index of 2^31 or more turns negative and passes the check, and the lookup then goes out of range. Both index helpers now compare in uint64. 64-bit builds behave the same as before.

Tests
A new subtest in TestMetricsBatchBuilder merges time series and events with 0xffffffff indexes. It fails without the fix in a linux/386 build and passes with it. The full utils package passes under 386.

Not verified
GOARCH=arm.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boks1971 boks1971 self-assigned this Nov 5, 2026
@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 72d28e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
github.com/livekit/protocol Patch
@livekit/protocol Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@boks1971
boks1971 requested a review from a team November 5, 2026 06:12
@boks1971
boks1971 marked this pull request as ready for review November 5, 2026 06:12
@boks1971
boks1971 merged commit 20b49cd into main Nov 5, 2026
9 checks passed
@boks1971
boks1971 deleted the raja/metrics-batch-index branch November 5, 2026 06:23
@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants