Make sure the PID read from charon.pid is null-terminated.

This commit is contained in:
Tobias Brunner 2011-09-28 12:01:47 +02:00
parent 6bdcd278a6
commit 6d36f8b60a
1 changed files with 1 additions and 0 deletions

View File

@ -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);