aboutsummaryrefslogtreecommitdiffstats
path: root/lib/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/path.c')
-rw-r--r--lib/path.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/path.c b/lib/path.c
index 9d4d3585b1..53bb798687 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -1042,7 +1042,7 @@ static int ul_path_cpuparse(struct path_cxt *pc, cpu_set_t **set, int maxcpus, i
goto out;
len = strlen(buf);
- if (buf[len - 1] == '\n')
+ if (len > 0 && buf[len - 1] == '\n')
buf[len - 1] = '\0';
*set = cpuset_alloc(maxcpus, &setsize, NULL);