In the checks to build only_in_b up the wrong const_iterator x is
build up. it should compare rhs->xattrs with xattrs entries and
not twice rhs->xattrs.
Fix for:
CID 716957 (#1 of 1): Invalid iterator comparison (MISMATCHED_ITERATOR)
mismatched_comparison: Comparing x from rhs->xattrs to this->xattrs.end()
from this->xattrs.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
only_in_a.clear();
only_in_b.clear();
diff.clear();
+
for (std::map < std::string, Xattr* >::const_iterator x = xattrs.begin();
x != xattrs.end(); ++x)
{
diff.push_back(x->first);
}
}
+
for (std::map < std::string, Xattr* >::const_iterator r = rhs->xattrs.begin();
r != rhs->xattrs.end(); ++r)
{
- std::map < std::string, Xattr* >::const_iterator x = rhs->xattrs.find(r->first);
+ std::map < std::string, Xattr* >::const_iterator x = xattrs.find(r->first);
if (x == xattrs.end()) {
only_in_b.push_back(r->first);
}