-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[mono][aot] Avoid use of local buffer that could overflow #118985
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR eliminates a potential buffer overflow vulnerability in the Mono AOT compiler by removing the use of a local buffer for symbol name handling. The change replaces sprintf
operations that could exceed buffer bounds with direct usage of existing symbol strings.
Key Changes:
- Removes local
symbol
buffer that was vulnerable to overflow - Eliminates unnecessary
sprintf
calls for symbol name copying - Uses
acfg->got_symbol
directly instead of copying to local buffer
@simonrozsival Looked over other uses of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I don't understand why the code copied the strings before - makes no sense...
Long time ago AOT code had a pattern of always using |
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2530461