Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: blauzahn on February 03, 2019, 02:56:06 pm

Title: cppcheck plugin; SIGSEGV fixed
Post by: blauzahn on February 03, 2019, 02:56:06 pm
The plugin crashed cb when cppcheck has been executed but returns with a failure. This happens e.g. when cppcheck complains about missing std.cfg.  I have observed this when using trunk for months on Linux amd64 (e.g. antergos). So, nothing that has changed recently.

The reason for this is a dereferencing nullptr in CppCheck.cpp:332

Code
if (nullptr!=resultNode->Attribute("version"))

->* has higher operator precedence than !=

The attached patch changes this to:

Code
if (nullptr!=resultNode && resultNode->Attribute("version"))

crashlog including gdb backtrace is attached as well.

If appropriate, can somebody please patch trunk?

Thank you in advance.
Title: Re: cppcheck plugin; SIGSEGV fixed
Post by: oBFusCATed on February 03, 2019, 06:44:24 pm
Thanks, I'll push it soon...
Title: Re: cppcheck plugin; SIGSEGV fixed
Post by: blauzahn on February 10, 2019, 11:17:19 am
Thank you.