mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09: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