[svn] Fix some cases where the size argument to strlcpy()

for usernames and hostnames is 1 too small.
This commit is contained in:
jilles 2007-03-04 17:14:46 -08:00
parent 61569b65f2
commit 14e23b0e1e
5 changed files with 25 additions and 9 deletions

View file

@ -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) jilles 2007/03/02 17:45:47 UTC (20070302-3223)
Log: Log:
Don't leak auth{} spoofed IP addresses in +f notices. Don't leak auth{} spoofed IP addresses in +f notices.

View file

@ -1 +1 @@
#define SERNO "20070302-3223" #define SERNO "20070304-3225"

View file

@ -48,7 +48,7 @@ struct Message chghost_msgtab = {
mapi_clist_av1 chghost_clist[] = { &chghost_msgtab, &realhost_msgtab, NULL }; 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() /* clean_host()
* *
@ -93,7 +93,7 @@ me_realhost(struct Client *client_p, struct Client *source_p,
return 0; return 0;
del_from_hostname_hash(source_p->orighost, source_p); 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)) if (irccmp(source_p->host, source_p->orighost))
SetDynSpoof(source_p); SetDynSpoof(source_p);
else else

View file

@ -7,7 +7,7 @@
* The authors takes no responsibility for any damage or loss * The authors takes no responsibility for any damage or loss
* of property which results from the use of this software. * 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 $ * 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, * 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]; char host_name[HOSTLEN + 1];
strlcpy(host_name, name, HOSTLEN); strlcpy(host_name, name, HOSTLEN + 1);
add_local_domain(host_name, HOSTLEN); add_local_domain(host_name, HOSTLEN);
if (request == NULL) if (request == NULL)
@ -682,7 +682,7 @@ static int proc_answer(struct reslist *request, HEADER * header, char *buf, char
else if (n == 0) else if (n == 0)
return (0); /* no more answers left */ return (0); /* no more answers left */
strlcpy(request->name, hostbuf, HOSTLEN); strlcpy(request->name, hostbuf, HOSTLEN + 1);
return (1); return (1);
break; break;

View file

@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * 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" #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); target_p->host, nick);
} }
strlcpy(target_p->username, user, USERLEN); strlcpy(target_p->username, user, sizeof target_p->username);
strlcpy(target_p->host, host, HOSTLEN); strlcpy(target_p->host, host, sizeof target_p->host);
if (changed) if (changed)
add_history(target_p, 1); add_history(target_p, 1);