mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
udevd: fix udevd read() calls to leave room for null byte
This commit is contained in:
4
udevd.c
4
udevd.c
@@ -195,7 +195,7 @@ static int running_processes(void)
|
||||
if (f == -1)
|
||||
return -1;
|
||||
|
||||
len = read(f, buf, sizeof(buf));
|
||||
len = read(f, buf, sizeof(buf)-1);
|
||||
close(f);
|
||||
|
||||
if (len <= 0)
|
||||
@@ -244,7 +244,7 @@ static int running_processes_in_session(pid_t session, int limit)
|
||||
if (f == -1)
|
||||
continue;
|
||||
|
||||
len = read(f, line, sizeof(line));
|
||||
len = read(f, line, sizeof(line)-1);
|
||||
close(f);
|
||||
|
||||
if (len <= 0)
|
||||
|
||||
Reference in New Issue
Block a user