mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
Merge pull request #10172 from lf-/jade/fix-9725
fix: bounds check result in getMaxCPU
This commit is contained in:
commit
0a11080c58
1 changed files with 5 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue