1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 23:03:53 -04:00

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")