mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
cgroup-util: tighten range check before casting to pid_t
This commit is contained in:
@@ -83,6 +83,8 @@ int cg_read_pid(FILE *f, pid_t *ret) {
|
||||
|
||||
if (ul <= 0)
|
||||
return -EIO;
|
||||
if (ul > PID_T_MAX)
|
||||
return -EIO;
|
||||
|
||||
*ret = (pid_t) ul;
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user