Buffer Overflow on screen.c#6308
Closed
Thiago4532 wants to merge 1 commit into
Closed
Conversation
Author
|
I made a mistake on the previous fix, now it should be good! |
Owner
|
On Sat, May 27, 2023 at 11:20:00AM -0700, Thiago Mota Martins wrote:
I am thinking about refactoring the function 'screen_erase_in_display' to prevent', the variables `a` and `b` are somewhat confusing, at least for me. Are you okay with Pull Requests to refactor the code? Or should I open an issue to have a discussion about refactoring?
I am fine with PRs to refactor code, I cant guarantee all such PRs would
be merged, of course. In this case a and b are simply the limits over
which the clearing operates. If you prefer other names for them, I dont
mind.
|
Owner
|
On Sat, May 27, 2023 at 03:11:03PM -0700, Thiago Mota Martins wrote:
I made a mistake on the previous fix, now it should be good!
I fixed it slightly differently, making sure the loop in
screen_dirty_line_graphics() is always over a valid range.
|
Author
|
I thought about that too! Happy that was fixed! The glitches on my terminal were so annoying, thanks! :) |
Owner
|
Thanks for tracking down the issue, saved me some time and headache. |
zchee
pushed a commit
to zchee/kitty
that referenced
this pull request
Jul 8, 2026
…g the screen Fixes kovidgoyal#6306 Fixes kovidgoyal#6308
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes the issue #6306.
There is a buffer overflow on the function
screen_dirty_line_graphics.This function loops from
[top, bottom]inclusive, but the functionscreen_erase_in_displaycallsscreen_dirty_line_graphicsfor the range[cursor, num_lines], causing a buffer overflow onlinebuf->line_attrs.Checking the value of
howbefore calling the functions solves the issue, the other calls toscreen_dirty_line_graphicsseems fine.