mirror of
https://github.com/lxc/lxcfs.git
synced 2026-02-05 09:46:18 +01:00
cpuset_parse: make a check for an empty string in cpu_in_cpuset()
Fixes: Coverity 382195 Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
This commit is contained in:
@@ -39,6 +39,9 @@ static int cpuset_getrange(const char *c, int *a, int *b)
|
||||
*/
|
||||
bool cpu_in_cpuset(int cpu, const char *cpuset)
|
||||
{
|
||||
if (!strlen(cpuset))
|
||||
return false;
|
||||
|
||||
for (const char *c = cpuset; c; c = cpuset_nexttok(c)) {
|
||||
int a, b, ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user