Skip to content

Fixes InvalidProgramException when reading push values outside the boundaries of the array#875

Merged
tonyredondo merged 1 commit into
masterfrom
tony/profilermaxstackfix
Aug 24, 2020
Merged

Fixes InvalidProgramException when reading push values outside the boundaries of the array#875
tonyredondo merged 1 commit into
masterfrom
tony/profilermaxstackfix

Conversation

@tonyredondo

@tonyredondo tonyredondo commented Aug 21, 2020

Copy link
Copy Markdown
Member

This PR fixes a possible InvalidProgramException when the IL method body contains switch statements due to invalid maxstack header value by reading outside the boundaries of the push values array. To mitigate this we add the missing values to the array.

Changes:

  • Adds the push value for both CEE_COUNT and CEE_SWITCH_ARG

@DataDog/apm-dotnet

@tonyredondo
tonyredondo requested a review from a team as a code owner August 21, 2020 16:32
@tonyredondo tonyredondo self-assigned this Aug 21, 2020
@zacharycmontoya

zacharycmontoya commented Aug 21, 2020

Copy link
Copy Markdown
Contributor

Can you leave a note about what issue this fixes? Otherwise this looks like a trivial change even though this provides a much needed fix. It would also help for better discoverability in the future 😄

@tonyredondo tonyredondo changed the title Fixes reading push values outside the range of the array Fixes InvalidProgramException when reading push values outside the range of the array Aug 22, 2020
@tonyredondo tonyredondo changed the title Fixes InvalidProgramException when reading push values outside the range of the array Fixes InvalidProgramException when reading push values outside the boundaries of the array Aug 22, 2020
@tonyredondo

Copy link
Copy Markdown
Member Author

I’ve changed the PR’s title and description to be more explicit with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants