瀏覽代碼

* Fix another overlapping strcpy() [ircfuzz]

Bryan Drewery 16 年之前
父節點
當前提交
089ae51d3e
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/mod/server.mod/servmsg.c

+ 4 - 1
src/mod/server.mod/servmsg.c

@@ -711,7 +711,10 @@ static int gotnotice(char *from, char *msg)
       *p = 0;
       strlcpy(ctcpbuf, p1, sizeof(ctcpbuf));
       ctcp = ctcpbuf;
-      strcpy(p1 - 1, p + 1);
+
+      /* remove the ctcp in msg */
+      memmove(p1 - 1, p + 1, strlen(p + 1) + 1);
+
       if (!ignoring)
 	detect_flood(nick, uhost, from, FLOOD_CTCP);
       p = strchr(ctcpmsg, 1);