From 337dfe0d069b0309b66becc87c6d7b5dfabaedd5 Mon Sep 17 00:00:00 2001 From: Tim Cava Date: Thu, 15 Aug 2013 09:18:14 +0000 Subject: [PATCH] Don't copy into a passwd struct returned by getpwuid(). git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@324 13b04d17-f746-0410-82c6-800466cd88b0 --- source/ctcp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/ctcp.c b/source/ctcp.c index 1a93785..883b1bb 100644 --- a/source/ctcp.c +++ b/source/ctcp.c @@ -1001,14 +1001,14 @@ const char *my_host; * latter because it invokes less suspicion in the long run * -- Jake [WinterHawk] Khuon */ - if ((ctcpuser = getenv("IRCUSER"))) - strmcpy(pwd->pw_name, ctcpuser, NAME_LEN); - if ((ctcpfinger = getenv("IRCFINGER"))) - strmcpy(pwd->pw_gecos, ctcpfinger, NAME_LEN); + if (!(ctcpuser = getenv("IRCUSER"))) + ctcpuser = pwd->pw_name; + if (!(ctcpfinger = getenv("IRCFINGER"))) + ctcpfinger = pwd->pw_gecos; send_ctcp(CTCP_NOTICE, from, CTCP_FINGER, "%s (%s@%s) Idle %ld second%s", - pwd->pw_gecos, pwd->pw_name, my_host, diff, plural(diff)); + ctcpfinger, ctcpuser, my_host, diff, plural(diff)); return NULL; }