Skip to content

Commit

Permalink
Fix use after free
Browse files Browse the repository at this point in the history
This could cause an immediate crash or incorrect values might be read
subsequently resulting in incorrect computations.

In QtFlagPropertyManager::uninitializeProperty(QtProperty *): A
pointer to freed memory is dereferenced, used as a function argument, or
otherwise used (CWE-416)

Coverity-Id: 22622
Change-Id: I24fc9d6f7c1c516ddcadaaba2ba7cdaed7c7f807
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
  • Loading branch information
jsfdez committed Oct 24, 2017
1 parent a8dda66 commit ee17851
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qtpropertybrowser/src/qtpropertymanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5355,8 +5355,8 @@ void QtFlagPropertyManager::setFlagNames(QtProperty *property, const QStringList
while (itProp.hasNext()) {
QtProperty *prop = itProp.next();
if (prop) {
delete prop;
d_ptr->m_flagToProperty.remove(prop);
delete prop;
}
}
d_ptr->m_propertyToFlags[property].clear();
Expand Down Expand Up @@ -5396,8 +5396,8 @@ void QtFlagPropertyManager::uninitializeProperty(QtProperty *property)
while (itProp.hasNext()) {
QtProperty *prop = itProp.next();
if (prop) {
delete prop;
d_ptr->m_flagToProperty.remove(prop);
delete prop;
}
}
d_ptr->m_propertyToFlags.remove(property);
Expand Down

0 comments on commit ee17851

Please sign in to comment.