Skip to content

Commit

Permalink
Fix strcpy-param-overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelortmann committed Jun 13, 2024
1 parent d58f563 commit b65d810
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mod/filesys.mod/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static int resolve_dir(char *current, char *change, char **real, int idx)
*p = 0;
p++;
malloc_strcpy(elem, new);
strcpy(new, p);
memmove(new, p, strlen(p) + 1);
if (!elem[0] || !strcmp(elem, ".")) {
p = strchr(new, '/');
continue;
Expand Down
4 changes: 2 additions & 2 deletions src/mod/irc.mod/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2599,7 +2599,7 @@ static int gotmsg(char *from, char *msg)
*p = 0;
ctcp = buf2;
strlcpy(buf2, p1, sizeof buf2);
memmove(p1 - 1, p + 1, strlen(p));
memmove(p1 - 1, p + 1, strlen(p + 1) + 1);
detect_chan_flood(nick, uhost, from, chan, strncmp(ctcp, "ACTION ", 7) ?
FLOOD_CTCP : FLOOD_PRIVMSG, NULL);

Expand Down Expand Up @@ -2734,7 +2734,7 @@ static int gotnotice(char *from, char *msg)
*p = 0;
ctcp = buf2;
strcpy(ctcp, p1);
memmove(p1 - 1, p + 1, strlen(p));
memmove(p1 - 1, p + 1, strlen(p + 1) + 1);
p = strchr(msg, 1);
detect_chan_flood(nick, uhost, from, chan,
strncmp(ctcp, "ACTION ", 7) ?
Expand Down
2 changes: 1 addition & 1 deletion src/mod/server.mod/servmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ static int gotmsg(char *from, char *msg)
ctcp = ctcpbuf;

/* remove the ctcp in msg */
memmove(p1 - 1, p + 1, strlen(p));
memmove(p1 - 1, p + 1, strlen(p + 1) + 1);

if (!ignoring)
detect_flood(nick, uhost, from,
Expand Down

0 comments on commit b65d810

Please sign in to comment.