From 25107247373df4aa75bddc2c2befd7c2dfadec6c Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sun, 3 Jan 2010 21:20:56 +0000 Subject: [PATCH] Fix SF bug #2895252 by changing the trailing space to a nul character. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1929 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 5 +++++ ircd/m_names.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index b1bbe6b..d6a5479 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-03 Michael Poole + + * ircd/m_names.c (m_names): Terminate the buffer used for listing + clients who are not in any channel. + 2010-01-03 Michael Poole * ircd/channel.c (find_delayed_joins): Move earlier in the file. diff --git a/ircd/m_names.c b/ircd/m_names.c index 6c84d50..157b7ee 100644 --- a/ircd/m_names.c +++ b/ircd/m_names.c @@ -285,6 +285,7 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (mlen + idx + NICKLEN + 3 > BUFSIZE) /* space, \r\n\0 */ { + buf[idx-1] = '\0'; send_reply(sptr, RPL_NAMREPLY, buf); strcpy(buf, "* * :"); idx = 5; @@ -292,7 +293,10 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) } } if (flag) + { + buf[idx-1] = '\0'; send_reply(sptr, RPL_NAMREPLY, buf); + } send_reply(sptr, RPL_ENDOFNAMES, "*"); } else if ((chptr = FindChannel(para)) != NULL) -- 2.20.1