mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
pulse-server: Error out if pid file name would be too long
This commit is contained in:
parent
6e2f78fffc
commit
ac9bcdee31
1 changed files with 4 additions and 0 deletions
|
|
@ -6015,6 +6015,10 @@ static int create_pid_file(void) {
|
||||||
if ((res = get_runtime_dir(pid_file, sizeof(pid_file), "pulse")) < 0) {
|
if ((res = get_runtime_dir(pid_file, sizeof(pid_file), "pulse")) < 0) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
if (strlen(pid_file) > PATH_MAX - 5) {
|
||||||
|
pw_log_error(NAME" %s/pid too long", pid_file);
|
||||||
|
return -ENAMETOOLONG;
|
||||||
|
}
|
||||||
strcat(pid_file, "/pid");
|
strcat(pid_file, "/pid");
|
||||||
|
|
||||||
snprintf(pid_str, sizeof(pid_str), "%lu\n", (unsigned long)getpid());
|
snprintf(pid_str, sizeof(pid_str), "%lu\n", (unsigned long)getpid());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue