Skip to content

Commit 09ddd93

Browse files
committed
cgroup: skip parsing empty file
Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent 9f44e82 commit 09ddd93

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libcrun/cgroup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,9 @@ read_pids_cgroup (int dfd, bool recurse, pid_t **pids, size_t *n_pids, size_t *a
18191819
if (UNLIKELY (ret < 0))
18201820
return ret;
18211821

1822+
if (len == 0)
1823+
return 0;
1824+
18221825
for (n_new_pids = 0, it = buffer; it; it = strchr (it + 1, '\n'))
18231826
n_new_pids++;
18241827

0 commit comments

Comments
 (0)