mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
pvs-studio: (V522) Prevent possible null-pointer dereference in RemoveRPathELF
This commit is contained in:
1 parent
77b874baa8
commit
e2f4b9bedc
2 files changed
+2
-3
No files matched your search
@@ -6,8 +6,6 @@
|
||||
//-V::508
|
||||
# The 'x' variable is assigned values twice successively. Perhaps this is a mistake.
|
||||
//-V::519
|
||||
# Possible null pointer dereference.
|
||||
//-V::522
|
||||
# Constant value is represented by an octal form.
|
||||
//-V::536
|
||||
# Iterators are passed as arguments to 'Foo' function. Consider inspecting the expression.
|
||||
|
||||
@@ -3889,7 +3889,8 @@ static cm::optional<bool> RemoveRPathELF(std::string const& file,
|
||||
// There is no RPATH or RUNPATH anyway.
|
||||
return true;
|
||||
}
|
||||
if (se_count == 2 && se[1]->IndexInSection < se[0]->IndexInSection) {
|
||||
if (se_count == 2 && se[0] && se[1] &&
|
||||
se[1]->IndexInSection < se[0]->IndexInSection) {
|
||||
std::swap(se[0], se[1]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user