]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: fix the buffer size to read /proc/cgroups
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 8 Feb 2022 16:44:50 +0000 (09:44 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 8 Feb 2022 16:44:55 +0000 (09:44 -0700)
commit5f813b5385b739236a4d6614f99160d664b871a2
treeab6e8097f90fdcdd41e37662c1ea19d484fda104
parent6980b4415237c6ff08b82e77e06c93f3ffc5ef3d
api.c: fix the buffer size to read /proc/cgroups

In cgroup_init(), the first line/header of /proc/cgroups helps in
interpreting the values in the remaining of the file.  We are interested
in the rest of the file and a temporary buffer of size FILENAME_MAX is
allocated/deallocated after reading the header. The length of the header
is only 56 characters in length, excluding the newline. This patch
reduces it to LL_MAX a.k.a 100 characters.

LL_MAX is used instead of introducing another new length macro.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c