From 14e23b0e1e595ef97e15f90c74749e7345f6abd7 Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 4 Mar 2007 17:14:46 -0800 Subject: [PATCH] [svn] Fix some cases where the size argument to strlcpy() for usernames and hostnames is 1 too small. --- ChangeLog | 16 ++++++++++++++++ include/serno.h | 2 +- modules/m_chghost.c | 4 ++-- src/res.c | 6 +++--- src/s_user.c | 6 +++--- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d84b209..efd2a2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +jilles 2007/03/04 23:42:55 UTC (20070304-3225) + Log: + Cut down quit/part/kick reasons to avoid quit reasons + overflowing the client exiting server notice (from + TOPICLEN to 260). kill reasons become shorter accordingly. + kline/dline/gline reasons become 390. + away messages stay at TOPICLEN for now. + + + Changes: Modified: + +8 -3 trunk/include/ircd_defs.h (File Modified) + +2 -2 trunk/modules/m_dline.c (File Modified) + +4 -4 trunk/modules/m_gline.c (File Modified) + +2 -2 trunk/modules/m_kline.c (File Modified) + + jilles 2007/03/02 17:45:47 UTC (20070302-3223) Log: Don't leak auth{} spoofed IP addresses in +f notices. diff --git a/include/serno.h b/include/serno.h index a00298d..3b44107 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070302-3223" +#define SERNO "20070304-3225" diff --git a/modules/m_chghost.c b/modules/m_chghost.c index fcf87a8..fbb9022 100644 --- a/modules/m_chghost.c +++ b/modules/m_chghost.c @@ -48,7 +48,7 @@ struct Message chghost_msgtab = { mapi_clist_av1 chghost_clist[] = { &chghost_msgtab, &realhost_msgtab, NULL }; -DECLARE_MODULE_AV1(chghost, NULL, NULL, chghost_clist, NULL, NULL, "$Revision: 1865 $"); +DECLARE_MODULE_AV1(chghost, NULL, NULL, chghost_clist, NULL, NULL, "$Revision: 3227 $"); /* clean_host() * @@ -93,7 +93,7 @@ me_realhost(struct Client *client_p, struct Client *source_p, return 0; del_from_hostname_hash(source_p->orighost, source_p); - strlcpy(source_p->orighost, parv[1], HOSTLEN); + strlcpy(source_p->orighost, parv[1], sizeof source_p->orighost); if (irccmp(source_p->host, source_p->orighost)) SetDynSpoof(source_p); else diff --git a/src/res.c b/src/res.c index 88170f0..f0a253f 100644 --- a/src/res.c +++ b/src/res.c @@ -7,7 +7,7 @@ * The authors takes no responsibility for any damage or loss * of property which results from the use of this software. * - * $Id: res.c 2023 2006-09-02 23:47:27Z jilles $ + * $Id: res.c 3227 2007-03-05 01:14:46Z jilles $ * from Hybrid Id: res.c 459 2006-02-12 22:21:37Z db $ * * July 1999 - Rewrote a bunch of stuff here. Change hostent builder code, @@ -408,7 +408,7 @@ static void do_query_name(struct DNSQuery *query, const char *name, struct resli { char host_name[HOSTLEN + 1]; - strlcpy(host_name, name, HOSTLEN); + strlcpy(host_name, name, HOSTLEN + 1); add_local_domain(host_name, HOSTLEN); if (request == NULL) @@ -682,7 +682,7 @@ static int proc_answer(struct reslist *request, HEADER * header, char *buf, char else if (n == 0) return (0); /* no more answers left */ - strlcpy(request->name, hostbuf, HOSTLEN); + strlcpy(request->name, hostbuf, HOSTLEN + 1); return (1); break; diff --git a/src/s_user.c b/src/s_user.c index a6196d6..8589c40 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: s_user.c 3219 2007-02-24 19:34:28Z jilles $ + * $Id: s_user.c 3227 2007-03-05 01:14:46Z jilles $ */ #include "stdinc.h" @@ -1452,8 +1452,8 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use target_p->host, nick); } - strlcpy(target_p->username, user, USERLEN); - strlcpy(target_p->host, host, HOSTLEN); + strlcpy(target_p->username, user, sizeof target_p->username); + strlcpy(target_p->host, host, sizeof target_p->host); if (changed) add_history(target_p, 1);