aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2011-09-28 12:01:47 +0200
committerTobias Brunner <tobias@strongswan.org>2011-09-28 13:57:59 +0200
commit6d36f8b60a947e144c6b4831f5cdde46aad2b865 (patch)
treef340f0166db3b2e0bb6cc1ddd7b719039cc9217b /src/charon
parent6bdcd278a6041cf15410ffb8683e4a8d4a24d876 (diff)
downloadstrongswan-6d36f8b60a947e144c6b4831f5cdde46aad2b865.tar.bz2
strongswan-6d36f8b60a947e144c6b4831f5cdde46aad2b865.tar.xz
Make sure the PID read from charon.pid is null-terminated.
Diffstat (limited to 'src/charon')
-rw-r--r--src/charon/charon.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/charon/charon.c b/src/charon/charon.c
index 96cf0c599..9c6f47830 100644
--- a/src/charon/charon.c
+++ b/src/charon/charon.c
@@ -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);