]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
src/api: Fix ret value in cgroup_get_current_controller_path()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 17 Jul 2024 07:30:48 +0000 (13:00 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 18 Jul 2024 16:15:03 +0000 (10:15 -0600)
commit03cfb388ae416c2c6dd5fda835f30f30a042ec91
tree5a201dd51358f5dcd6b57f9ae55adab2fc71d4a3
parent6bea4df6d283825f6664dae8eb79294ac8edf603
src/api: Fix ret value in cgroup_get_current_controller_path()

The CodeQL reported a warning:
"Incorrect return-value check for a 'scanf'-like function"

More information about the warning:
https://github.com/libcgroup/libcgroup/security/code-scanning/16

Fix the warning by adding an additional "EOF" check for the ret value
from fscanf() in the cgroup_get_current_controller_path()

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