Make sure the PID read from charon.pid is null-terminated.
This commit is contained in:
parent
6bdcd278a6
commit
6d36f8b60a
|
@ -242,6 +242,7 @@ static bool check_pidfile()
|
|||
memset(buf, 0, sizeof(buf));
|
||||
if (fread(buf, 1, sizeof(buf), pidfile))
|
||||
{
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
pid = atoi(buf);
|
||||
}
|
||||
fclose(pidfile);
|
||||
|
|
Loading…
Reference in New Issue