Skip to content

fix(types): Use checked arithmetic in envelope parsing#1122

Open
szokeasaurusrex wants to merge 1 commit intomasterfrom
szokeasaurusrex/checked-arithmetic-envelope
Open

fix(types): Use checked arithmetic in envelope parsing#1122
szokeasaurusrex wants to merge 1 commit intomasterfrom
szokeasaurusrex/checked-arithmetic-envelope

Conversation

@szokeasaurusrex
Copy link
Copy Markdown
Member

@szokeasaurusrex szokeasaurusrex commented May 7, 2026

Replace unchecked envelope parser offset arithmetic with checked operations and document the invariants that make each addition safe. This removes the file-level lint exception while keeping malformed envelope handling explicit.

Stacked on #1119

Closes #1118
Closes RUST-214

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 7, 2026

@szokeasaurusrex szokeasaurusrex requested a review from giortzisg May 7, 2026 09:34
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review May 7, 2026 09:34
@szokeasaurusrex szokeasaurusrex requested a review from lcian as a code owner May 7, 2026 09:34
Comment thread sentry-types/src/protocol/envelope.rs
Comment thread sentry-types/src/protocol/envelope.rs
@szokeasaurusrex szokeasaurusrex requested a review from lcian May 7, 2026 11:48
Base automatically changed from szokeasaurusrex/checked-arithmetic to master May 7, 2026 11:49
Replace unchecked envelope parser offset arithmetic with checked operations and document the invariants that make each addition safe. This removes the file-level lint exception while keeping malformed envelope handling explicit.

Closes #1118

Closes [RUST-214](https://linear.app/getsentry/issue/RUST-214/fix-checked-arithmetic-in-sentry-typessrcprotocolenvelopers)
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/checked-arithmetic-envelope branch from ccb12cd to 0889e82 Compare May 7, 2026 11:49
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