Fix #14877: heap-use-after-free in Tokenizer::simplifyUsing()#8679
Fix #14877: heap-use-after-free in Tokenizer::simplifyUsing()#8679GilmarSantosJr wants to merge 2 commits into
Conversation
|
Thanks for your contribution. Please move the test to testsimplifyusing.cpp. |
|
I have created this ticket: https://trac.cppcheck.net/ticket/14877 |
|
The test only covers the issue on line 3214. We should also have a test triggering it on line 3067 (if possible). I will give the fuzzer a try. |
That seems unlikely since deletion happens in line 3085ff. |
You are right, of course. |
Done. Thank you for the support and suggestions! |
You may also add yourself to the AUTHORS file. If you do, please add |
In a large codebase, constructs like
using C = struct C { C() {} };lead to errors such asCode.cpp:0:0: error: Bailing out from analysis: Checking file failed: out of memory [internalError].When compiling cppcheck using clang 22's address sanitizer, the analysis terminates with the following messages:
The proposed fix avoids storing a reference to a memory area that will eventually be deallocated before the reference is used.