Skip to content

Commit 0a82155

Browse files
authored
[O2-2559] Avoid out of rage access when smaps contains unexpected data (#267)
* [O2-2559] Avoid out of rage access when smaps contains unexpected data * Bump CMake
1 parent 19cd619 commit 0a82155

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ endif()
3131

3232
# Define project
3333
project(Monitoring
34-
VERSION 3.8.10
34+
VERSION 3.8.11
3535
DESCRIPTION "O2 Monitoring library"
3636
LANGUAGES CXX
3737
)

src/ProcessMonitor.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ double ProcessMonitor::splitStatusLineAndRetriveValue(const std::string& line) c
142142
std::istringstream iss(line);
143143
std::vector<std::string> tokens{std::istream_iterator<std::string>{iss},
144144
std::istream_iterator<std::string>{}};
145-
return std::stod(tokens[1]);
145+
return tokens.size() < 2 ? -1.0 : std::stod(tokens.at(1));
146146
}
147147

148148
std::vector<Metric> ProcessMonitor::getPerformanceMetrics()

0 commit comments

Comments
 (0)