Explorar el Código

* Fix another overlapping strcpy() [ircfuzz]

Bryan Drewery hace 16 años
padre
commit
089ae51d3e
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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);