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

Force rebuild of display table after removals #1519

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Conversation

cgzones
Copy link
Member

@cgzones cgzones commented Aug 14, 2024

Table_compact() is called after Table_cleanupRow(), which might remove
rows, which are still referenced by the display table. Set needsSort to
true so that Table_updateDisplayList() always performs a rebuild and
does access removed rows.

Fixes: #1517

Table_removeIndex() needs to be called with care, e.g. Vector_compact()
needs to be called afterwards.  Do no call by accident from external
code.
Table_compact() is called after Table_cleanupRow(), which might remove
rows, which are still referenced by the display table.  Set needsSort to
true so that Table_updateDisplayList() always performs a rebuild and
does access removed rows.

Fixes: htop-dev#1517
@cgzones cgzones added the bug 🐛 Something isn't working label Aug 14, 2024
@cgzones cgzones added this to the 3.4.0 milestone Aug 14, 2024
Copy link
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

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

LGTM.

@BenBE BenBE mentioned this pull request Aug 14, 2024
Copy link
Member

@natoscott natoscott left a comment

Choose a reason for hiding this comment

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

LGTM too.

@natoscott natoscott merged commit 0782be7 into htop-dev:main Aug 14, 2024
18 checks passed
@cgzones cgzones deleted the uaf branch August 24, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault when toggling threads visibility while paused
3 participants