Author Topic: cppcheck plugin; SIGSEGV fixed  (Read 805 times)

Offline blauzahn

  • Multiple posting newcomer
  • *
  • Posts: 101
cppcheck plugin; SIGSEGV fixed
« 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: [Select]
if (nullptr!=resultNode->Attribute("version"))

->* has higher operator precedence than !=

The attached patch changes this to:

Code: [Select]
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: cppcheck plugin; SIGSEGV fixed
« Reply #1 on: February 03, 2019, 06:44:24 pm »
Thanks, I'll push it soon...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline blauzahn

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: cppcheck plugin; SIGSEGV fixed
« Reply #2 on: February 10, 2019, 11:17:19 am »
Thank you.