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

This commit is contained in:
Tobias Brunner
2011-09-28 13:57:59 +02:00
parent 6bdcd278a6
commit 6d36f8b60a
+1
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);