diff options
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r-- | src/libutil/util.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 51cda9da4..bbd57434d 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -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") |