-
Notifications
You must be signed in to change notification settings - Fork 13
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
Memory bugs reported by AddressSanitizer #49
Comments
Bennctu
added a commit
to Bennctu/mado
that referenced
this issue
Sep 14, 2024
This commit adds a check to ensure the pointer 's' does not exceed the boundaries of the pixmap. By comparing 's' with 'max_pixel_ptr', we prevent potential heap overflow issues when iterating through the pixel data. The check is now performed before updating 's' to avoid unnecessary calculations if the pointer goes out of bounds. This change helps improve memory safety and prevents out-of-bounds access during pixel manipulation. Fix memory issues detected by AddressSanitizer: See: sysprog21#49
Bennctu
added a commit
to Bennctu/mado
that referenced
this issue
Sep 15, 2024
This commit adds a check to ensure the pointer 's' does not exceed the boundaries of the pixmap. By comparing 's' with 'max_pixel_ptr', we prevent potential heap-buffer-overflow when iterating through the pixel data. The check is now performed before updating 's' to avoid unnecessary calculations if the pointer goes out of bounds. This change helps improve memory safety and prevents out-of-bounds access during pixel manipulation. Close sysprog21#49
After #51, AddressSanitizer reports:
|
weihsinyeh
added a commit
to weihsinyeh/mado
that referenced
this issue
Oct 1, 2024
To fix the heap-use-after-free issue when `screen` is accessed by the `twin_sdl_work()` function, remove the `_twin_sdl_destroy(screen, tx)` operation. Additionally, to address the memory leak, add the `twin_path_destroy(path)` function to ensure the unused path is properly destroyed. Close sysprog21#49
weihsinyeh
added a commit
to weihsinyeh/mado
that referenced
this issue
Oct 2, 2024
To fix the heap-use-after-free issue when 'screen' is accessed by the 'twin_sdl_work()' function, remove the '_twin_sdl_destroy(screen, tx)' operation. Additionally, to address the memory leak, add the 'twin_path_destroy(path)' function to ensure the unused path is properly destroyed. Add the operation to deallocate 'frame', as it will no longer be used in the future. See: sysprog21#49
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enable AddressSanitizer with the following changes:
After enabling, some heap-buffer-overflow error occurs:
The text was updated successfully, but these errors were encountered: