mirror of
https://github.com/polybar/polybar.git
synced 2026-02-07 22:15:48 +00:00
fix(memory): Safety check
This commit is contained in:
@ -47,7 +47,9 @@ namespace modules {
|
||||
|
||||
while (std::getline(in, str) && i++ < 3) {
|
||||
size_t off = str.find_first_of("1234567890", str.find(':'));
|
||||
buffer << std::strtol(&str[off], nullptr, 10) << std::endl;
|
||||
if (off != string::npos && str.size() > off) {
|
||||
buffer << std::strtol(&str[off], nullptr, 10) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
buffer >> rdbuf;
|
||||
|
||||
Reference in New Issue
Block a user