Skip to content

Comments

Fix possible NULL deref when looking for PCP dynamic columns#1591

Merged
BenBE merged 1 commit intohtop-dev:mainfrom
BenBE:pcp-fix-col-lookup
Jan 22, 2025
Merged

Fix possible NULL deref when looking for PCP dynamic columns#1591
BenBE merged 1 commit intohtop-dev:mainfrom
BenBE:pcp-fix-col-lookup

Conversation

@BenBE
Copy link
Member

@BenBE BenBE commented Jan 18, 2025

Fixes a NULL deref found while working on #1587

This also does some code style cleanup of the caller.

@BenBE BenBE added bug 🐛 Something isn't working code quality ♻️ Code quality enhancement PCP PCP related issues labels Jan 18, 2025
@BenBE BenBE added this to the 3.4.0 milestone Jan 18, 2025
@BenBE BenBE requested review from fasterit and natoscott January 18, 2025 13:03
@fasterit fasterit removed their request for review January 18, 2025 15:26
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.

@BenBE LGTM. I thought we were using no-braces for single-line conditionals in general these days, but I'm not particularly fussed if you really want to change that in all these places. The new null-checking code updates there certainly all seem fine anyway. Thanks!

@BenBE BenBE merged commit 53f7e63 into htop-dev:main Jan 22, 2025
18 checks passed
@BenBE
Copy link
Member Author

BenBE commented Jan 22, 2025

@natoscott The brace-less variant is okay too, but within nested if's the em-brace-d (scnr) variant is preferred. The top two NULL checks could have been brace-less (single-line, freestanding); no particular preference there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 Something isn't working code quality ♻️ Code quality enhancement PCP PCP related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants