Permalink
Browse files

More strcpy() -> strlcpy()

Found by: thommey, michaelortmann
Patch by: michaelortmann
  • Loading branch information...
michaelortmann authored and vanosg committed Nov 25, 2018
1 parent 7cdd075 commit 6e1a6e25bd94382519078669cbc9b05fd9c91ab5
Showing with 8 additions and 8 deletions.
  1. +6 −6 src/mod/irc.mod/chan.c
  2. +2 −2 src/mod/server.mod/servmsg.c
@@ -1724,15 +1724,15 @@ static int gotjoin(char *from, char *chname)
}
if (!chan || channel_inactive(chan)) {
strcpy(uhost, from);
strlcpy(uhost, from, sizeof buf);
nick = splitnick(&uhost);
if (match_my_nick(nick)) {
putlog(LOG_MISC, "*", "joined %s but didn't want to!", chname);
dprintf(DP_MODE, "PART %s\n", chname);
}
} else if (!channel_pending(chan)) {
chan->status &= ~CHAN_STOP_CYCLE;
strcpy(uhost, from);
strlcpy(uhost, from, sizeof buf);
nick = splitnick(&uhost);
detect_chan_flood(nick, uhost, from, chan, FLOOD_JOIN, NULL);
@@ -2125,7 +2125,7 @@ static int gotnick(char *from, char *msg)
struct userrec *u;
struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
strcpy(uhost, from);
strlcpy(uhost, from, sizeof buf);
nick = splitnick(&uhost);
fixcolon(msg);
clear_chanlist_member(nick); /* Cache for nick 'nick' is meaningless now. */
@@ -2206,7 +2206,7 @@ static int gotquit(char *from, char *msg)
struct chanset_t *chan, *oldchan = NULL;
struct userrec *u;
strcpy(from2, from);
strlcpy(from2, from, sizeof from2);
nick = splitnick(&from);
fixcolon(msg);
/* Fred1: Instead of expensive wild_match on signoff, quicker method.
@@ -2302,7 +2302,7 @@ static int gotmsg(char *from, char *msg)
return 0; /* Unknown channel; don't process. */
fixcolon(msg);
strcpy(uhost, from);
strlcpy(uhost, from, sizeof buf);
nick = splitnick(&uhost);
ignoring = match_ignore(from);
@@ -2422,7 +2422,7 @@ static int gotnotice(char *from, char *msg)
if (!chan)
return 0; /* Notice to an unknown channel?? */
fixcolon(msg);
strcpy(uhost, from);
strlcpy(uhost, from, sizeof buf);
nick = splitnick(&uhost);
u = get_user_by_host(from);
@@ -491,7 +491,7 @@ static int gotmsg(char *from, char *msg)
ignoring = match_ignore(from);
to = newsplit(&msg);
fixcolon(msg);
strlcpy(uhost, from, sizeof(buf));
strlcpy(uhost, from, sizeof buf);
nick = splitnick(&uhost);
/* Apparently servers can send CTCPs now too, not just nicks */
if (nick[0] == '\0')
@@ -626,7 +626,7 @@ static int gotnotice(char *from, char *msg)
ignoring = match_ignore(from);
to = newsplit(&msg);
fixcolon(msg);
strcpy(uhost, from);
strlcpy(uhost, from, sizeof buf);
nick = splitnick(&uhost);
/* Check for CTCP: */

0 comments on commit 6e1a6e2

Please sign in to comment.