forked from qt-creator/qt-creator
C++: Fix null pointer dereference
Task-number: QTCREATORBUG-8698 Change-Id: If3181cb923ef7249945908c0610c16952262e881 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
6
src/libs/3rdparty/cplusplus/Name.cpp
vendored
6
src/libs/3rdparty/cplusplus/Name.cpp
vendored
@@ -79,5 +79,11 @@ bool Name::Compare::operator()(const Name *name, const Name *other) const
|
||||
|
||||
const Identifier *id = name->identifier();
|
||||
const Identifier *otherId = other->identifier();
|
||||
|
||||
if (id == 0)
|
||||
return otherId != 0;
|
||||
if (otherId == 0)
|
||||
return false;
|
||||
|
||||
return std::strcmp(id->chars(), otherId->chars()) < 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user