Skip to content

Commit

Permalink
[O2-2559] Avoid out of rage access when smaps contains unexpected data (
Browse files Browse the repository at this point in the history
#267)

* [O2-2559] Avoid out of rage access when smaps contains unexpected data

* Bump CMake
  • Loading branch information
awegrzyn authored Oct 17, 2021
1 parent 19cd619 commit 0a82155
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endif()

# Define project
project(Monitoring
VERSION 3.8.10
VERSION 3.8.11
DESCRIPTION "O2 Monitoring library"
LANGUAGES CXX
)
Expand Down
2 changes: 1 addition & 1 deletion src/ProcessMonitor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ double ProcessMonitor::splitStatusLineAndRetriveValue(const std::string& line) c
std::istringstream iss(line);
std::vector<std::string> tokens{std::istream_iterator<std::string>{iss},
std::istream_iterator<std::string>{}};
return std::stod(tokens[1]);
return tokens.size() < 2 ? -1.0 : std::stod(tokens.at(1));
}

std::vector<Metric> ProcessMonitor::getPerformanceMetrics()
Expand Down

0 comments on commit 0a82155

Please sign in to comment.