Skip to content

fix: out-of-bounds access in process_symbolization#533

Merged
KowalskiThomas merged 1 commit into
mainfrom
dd/kowalski/fix/process-symbolization-oob
Apr 1, 2026
Merged

fix: out-of-bounds access in process_symbolization#533
KowalskiThomas merged 1 commit into
mainfrom
dd/kowalski/fix/process-symbolization-oob

Conversation

@KowalskiThomas

@KowalskiThomas KowalskiThomas commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes an out-of-bounds array access in the process_symbolization function inside ddprof_pprof.cc.

In the inner loop that collects consecutive locations for the same file, index is incremented via ++index before checking locs[index].symbol_idx. When the last element of locs is reached inside the loop, index becomes equal to locs.size() and the subsequent access to locs[index] is out of bounds, result in undefined behavior.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Apr 1, 2026

Copy link
Copy Markdown

View session in Datadog

Bits Dev status: ✅ Done

Comment @DataDog to request changes

@datadog-official

Copy link
Copy Markdown

I can only run on private repositories.

@r1viollet r1viollet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KowalskiThomas
KowalskiThomas force-pushed the dd/kowalski/fix/process-symbolization-oob branch 2 times, most recently from 9ab74a5 to 81467a8 Compare April 1, 2026 11:39
@KowalskiThomas
KowalskiThomas marked this pull request as ready for review April 1, 2026 11:39
@KowalskiThomas
KowalskiThomas requested a review from nsavoire as a code owner April 1, 2026 11:39
@KowalskiThomas KowalskiThomas added the bug Something isn't working label Apr 1, 2026
@KowalskiThomas
KowalskiThomas force-pushed the dd/kowalski/fix/process-symbolization-oob branch from 81467a8 to 7abc1a9 Compare April 1, 2026 11:56
@KowalskiThomas
KowalskiThomas merged commit 08033d3 into main Apr 1, 2026
3 checks passed
@KowalskiThomas
KowalskiThomas deleted the dd/kowalski/fix/process-symbolization-oob branch April 1, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bits AI bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants