diff --git a/.pvsconfig b/.pvsconfig index df665de4df..2cb7888fa0 100644 --- a/.pvsconfig +++ b/.pvsconfig @@ -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. diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 79767575ea..d7a71f04a6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -3889,7 +3889,8 @@ static cm::optional 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]); }