1
0
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:
Alexander Mikhalitsyn
2025-01-31 10:44:22 +01:00
parent 531a988d49
commit 3aa1bb65b7

View File

@@ -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;