mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-22 11:53:16 +00:00
make sure old_pid_buffer is null terminated
This commit is contained in:
parent
a1a397420e
commit
ef18915ca5
@ -1140,7 +1140,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (switch_file_open(&fd, pid_path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, pool) == SWITCH_STATUS_SUCCESS) {
|
if (switch_file_open(&fd, pid_path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, pool) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
|
||||||
old_pid_len = sizeof(old_pid_buffer);
|
old_pid_len = sizeof(old_pid_buffer) -1;
|
||||||
switch_file_read(fd, old_pid_buffer, &old_pid_len);
|
switch_file_read(fd, old_pid_buffer, &old_pid_len);
|
||||||
switch_file_close(fd);
|
switch_file_close(fd);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user