From 00c7d1ba5d3bf6852e97e39364f30a22b1ebee16 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sat, 17 Jun 2006 13:09:14 +0000 Subject: [PATCH] Fix bug in PASS handling. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1668 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 4 ++++ ircd/m_pass.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7fe342c..6b54d66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-06-17 Michael Poole + + * ircd/m_pass.c (mr_pass): Only back 'len' up when it's safe. + 2006-06-08 Michael Poole * ircd/m_whois.c (do_whois): Prefix '*' to names of secret (local) diff --git a/ircd/m_pass.c b/ircd/m_pass.c index b1aef62..eb08e9f 100644 --- a/ircd/m_pass.c +++ b/ircd/m_pass.c @@ -112,7 +112,9 @@ int mr_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) len += strlen(parv[arg]); password[len++] = ' '; } - password[--len] = '\0'; + if (len > 0) + --len; + password[len] = '\0'; if (EmptyString(password)) return need_more_params(cptr, "PASS"); -- 2.20.1