diff --git a/Changelog b/Changelog index e7e3639..73bd04c 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2c01 ] +* [1.1s01] Fixed .cmsg crash reported by zimzum. (caf) + * Changed the defaults for JOIN_NEW_WINDOW_TYPE and QUERY_NEW_WINDOW_TYPE so that they work out of the box. (caf) diff --git a/source/bot_link.c b/source/bot_link.c index 53a7b4f..53419a7 100644 --- a/source/bot_link.c +++ b/source/bot_link.c @@ -654,19 +654,22 @@ SocketList *s; int cmd_cmsg(int idx, char *par) { -char *nick, *user; -SocketList *s, *s1 = NULL; + char *nick, *user; + SocketList *s, *s1 = NULL; + + nick = next_arg(par, &par); - nick = LOCAL_COPY(next_arg(par, &par)); - if ((user = strchr(nick, '@'))) - *user++ = '\0'; if (nick) { int i; + + if ((user = strchr(nick, '@'))) + *user++ = '\0'; + for (i = 0; i < get_max_fd()+1; i++) { if (!check_dcc_socket(i)) continue; - if (idx == i) { s1 = get_socketinfo(i); break; } + if (idx == i) { s1 = get_socket(i); break; } } if (!s1) return TCL_OK; s = find_dcc(nick, "chat", NULL, DCC_CHAT, 0, 1, -1);