Coverity FORWARD_NULL - CID 12459 - src/match.cpp - in function: matchOpsEqual(std::list<MatchOp *, std::allocator<MatchOp *>> &, std::list<MatchOp *, std::allocator<MatchOp *>> &) - Dynamic cast to pointer "dynamic_cast <MatchExpOp *>(*it2)" can return NULL. Assigning: "e2" = "dynamic_cast <MatchExpOp *>(*it2)". Passing null pointer "e2->value" to function "std::operator !=<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const &)", which dereferences it.

Bug #1101598 reported by Product Strategy Coverity Bug Uploader on 2013-01-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compiz
High
Unassigned
0.9.9
High
Unassigned

Bug Description

This bug is exported from the Coverity Integration Manager on Canonical's servers. For information on how this is done please see this website: https://wiki.ubuntu.com/CanonicalProductStrategy/Coverity
CID: 12459
Checker: FORWARD_NULL
Category: dynamic_cast
CWE definition: http://cwe.mitre.org/data/definitions/476.html
File: /tmp/buildd/compiz-0.9.9~daily13.01.14/src/match.cpp
Function: matchOpsEqual(std::list<MatchOp *, std::allocator<MatchOp *>> &, std::list<MatchOp *, std::allocator<MatchOp *>> &)
Code snippet:
225
226 break;
227 case MatchOp::TypeExp:
228 e1 = dynamic_cast<MatchExpOp *> (*it1);
CID 12459 - FORWARD_NULL
Dynamic cast to pointer "dynamic_cast <MatchExpOp *>(*it2)" can return NULL.
Assigning: "e2" = "dynamic_cast <MatchExpOp *>(*it2)".
229 e2 = dynamic_cast<MatchExpOp *> (*it2);
230
CID 12459 - FORWARD_NULL
Passing null pointer "e2->value" to function "std::operator !=<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const &)", which dereferences it.
231 if (e1->value != e2->value)
232 return false;
233
234 break;

Source file with Coverity annotations.

Changed in compiz:
importance: Undecided → High
MC Return (mc-return) on 2013-07-06
summary: - Coverity FORWARD_NULL - CID 12459
+ Coverity FORWARD_NULL - CID 12459 - src/match.cpp - in function:
+ matchOpsEqual(std::list<MatchOp *, std::allocator<MatchOp *>> &,
+ std::list<MatchOp *, std::allocator<MatchOp *>> &) - Dynamic cast to
+ pointer "dynamic_cast <MatchExpOp *>(*it2)" can return NULL. Assigning:
+ "e2" = "dynamic_cast <MatchExpOp *>(*it2)". Passing null pointer
+ "e2->value" to function "std::operator !=<char, std::char_traits<char>,
+ std::allocator<char> >(std::basic_string<char, std::char_traits<char>,
+ std::allocator<char> > const &, std::basic_string<char,
+ std::char_traits<char>, std::allocator<char> > const &)", which
+ dereferences it.
Changed in compiz:
milestone: none → 0.9.10.0
MC Return (mc-return) on 2013-07-24
Changed in compiz:
milestone: 0.9.10.0 → 0.9.11.0
Stephen M. Webb (bregma) on 2014-11-18
Changed in compiz:
status: New → Confirmed
milestone: 0.9.11.0 → 0.9.12.1
Stephen M. Webb (bregma) on 2015-02-03
Changed in compiz:
milestone: 0.9.12.1 → 0.9.12.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers