Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UB in dwarf/dwarf_subrange.cpp::get_type #1402

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

hainest
Copy link
Contributor

@hainest hainest commented Mar 23, 2023

The dwarf_* functions return a pointer to their last argument. This causes 'get_type' to return a pointer to a local variable.

The dwarf_* functions return a pointer to their last argument. This causes 'get_type' to return a pointer to a local variable.
@hainest hainest added bug DWARF Item is related to DWARF parsing labels Mar 23, 2023
@hainest hainest requested a review from kupsch March 23, 2023 04:08
@hainest hainest self-assigned this Mar 23, 2023
Copy link
Contributor

@kupsch kupsch left a comment

Choose a reason for hiding this comment

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

I also wrote and tested this exact change and it corrects the problem.

@hainest hainest merged commit b1ddebd into master Mar 23, 2023
@hainest hainest deleted the fix_ub_dwarf_subrange_get_type branch March 23, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug DWARF Item is related to DWARF parsing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants