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

CheckBufferOverrun: bail out early in getBufferSize() #7134

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

firewave
Copy link
Collaborator

No description provided.

@@ -561,6 +561,9 @@ ValueFlow::Value CheckBufferOverrun::getBufferSize(const Token *bufTok) const
if (!var)
return ValueFlow::Value(-1);

if (var->isPointer())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be merged with the previous condition.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

I initially had dim still before the condition so they were not next to each other.

@chrchr-github chrchr-github merged commit 07797da into danmar:main Dec 29, 2024
60 checks passed
@firewave firewave deleted the checkbuffer-early branch December 29, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants