Issues found by Clang static analyzer

Bug #1314206 reported by Jussi Pakkanen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dbus-cpp
New
Undecided
Unassigned

Bug Description

Running trunk static analyzer on DBus-cpp trunk uncovers some errors. Some are fixed by the std::move fix, the rest are as follows.

match_rule.cpp returns reference to a local variable's data:

dbus::MatchRule& dbus::MatchRule::args(const MatchArgs& p) const
{
MatchRule result {*this};
return result.args(p); // <- Right here
}

There are several dead assignments in generator.cpp. They are in function update() and here's the first one:

case DBUS_STRUCT_BEGIN_CHAR:
result = state.update_for_type(ArgumentType::structure);
result = state.update_for_struct_start();
break;

I didn't fix these myself because I'm not 100% sure what the correct fix is.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.