Merge pull request #10172 from lf-/jade/fix-9725

fix: bounds check result in getMaxCPU
This commit is contained in:
tomberek 2024-03-07 00:58:44 -05:00 committed by GitHub
commit 0a11080c58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,6 +38,11 @@ unsigned int getMaxCPU()
auto cpuMax = readFile(cpuFile);
auto cpuMaxParts = tokenizeString<std::vector<std::string>>(cpuMax, " \n");
if (cpuMaxParts.size() != 2) {
return 0;
}
auto quota = cpuMaxParts[0];
auto period = cpuMaxParts[1];
if (quota != "max")