Skip to content

Fix use-after-free crash when using --clang#5367

Merged
chrchr-github merged 3 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_clanglist
Aug 28, 2023
Merged

Fix use-after-free crash when using --clang#5367
chrchr-github merged 3 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_clanglist

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

Still ran into an assert failure in Tokenizer::hasIfdef(), since some checks assume that the tokenizer is always present. Seems like clangimport is yet another rogue under-tested feature...

@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Aug 24, 2023

Seems like clangimport is yet another rogue under-tested feature...

yes unfortunately. In my opinion it's highly experimental still :-(

Comment thread lib/symboldatabase.cpp
return &argumentList[num];
if (num < argumentList.size()) {
auto it = argumentList.begin();
std::advance(it, num);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't understand.. is this safer or faster in some way?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

How would you do it with a std::list?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok understood.. it seems unfortunate to use a std::list but not sure how to solve it properly with the vector. :-(

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Filed https://trac.cppcheck.net/ticket/11895 for the FP.

@chrchr-github chrchr-github merged commit 4d18f3e into cppcheck-opensource:main Aug 28, 2023
@chrchr-github chrchr-github deleted the chr_clanglist branch August 28, 2023 07:28
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