Merge "fix: bounds check result in getMaxCPU" into main
This commit is contained in:
commit
0d9a043f43
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue