diff options
author | Martin Willi <martin@strongswan.org> | 2008-11-10 15:45:19 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-11-10 15:45:19 +0000 |
commit | ae42288a81e9d616e6488bd92ec575e3efe34dfc (patch) | |
tree | 87429d201b3665b2021e0248ad3ea66b046315b7 /src/dumm | |
parent | e9a0d3a3397048d2569592a9b7083dae4a95e84c (diff) | |
download | strongswan-ae42288a81e9d616e6488bd92ec575e3efe34dfc.tar.bz2 strongswan-ae42288a81e9d616e6488bd92ec575e3efe34dfc.tar.xz |
fixed some minor issues found when using -DFORTIFY_SOURCE=2
Diffstat (limited to 'src/dumm')
-rw-r--r-- | src/dumm/mconsole.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dumm/mconsole.c b/src/dumm/mconsole.c index f071ad47f..02db5ab7e 100644 --- a/src/dumm/mconsole.c +++ b/src/dumm/mconsole.c @@ -247,7 +247,7 @@ static bool wait_for_notify(private_mconsole_t *this, char *nsock) } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; - strncpy(addr.sun_path, nsock, sizeof(addr)); + strncpy(addr.sun_path, nsock, sizeof(addr.sun_path)); if (bind(this->notify, (struct sockaddr*)&addr, sizeof(addr)) < 0) { DBG1("binding mconsole notify socket to '%s' failed: %m", nsock); @@ -306,7 +306,7 @@ static bool setup_console(private_mconsole_t *this) } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; - snprintf(&addr.sun_path[1], sizeof(addr.sun_path), "%5d-%d", + snprintf(&addr.sun_path[1], sizeof(addr.sun_path)-1, "%5d-%d", getpid(), this->console); if (bind(this->console, (struct sockaddr*)&addr, sizeof(addr)) < 0) { |