Merge "fix: bounds check result in getMaxCPU" into main

This commit is contained in:
jade 2024-03-06 22:24:51 -07:00 committed by Gerrit Code Review
commit 0d9a043f43

View file

@ -796,6 +796,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")