Browse Source

* Fixed segfault with /ctcp chat.

svn: 2392
Bryan Drewery 21 years ago
parent
commit
76125e7bd7
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/dcc.c

+ 6 - 4
src/dcc.c

@@ -1662,6 +1662,12 @@ dcc_telnet_pass(int idx, int atr)
   if ((conf.bot->hub && !glob_huba(fr)) || (!conf.bot->hub && ischanhub() && !glob_chuba(fr)))
     dcc[idx].status |= STAT_PARTY;
 
+  if (!dcc[idx].bot) {
+    //bots dont need this
+    dcc[idx].u.chat = (struct chat_info *) my_calloc(1, sizeof(struct chat_info));
+    strcpy(dcc[idx].u.chat->con_chan, chanset ? chanset->dname : "*");
+  }
+
   if (conf.bot->hub) {
     if (dcc[idx].bot) {
       /* negotiate a new linking scheme */
@@ -1677,10 +1683,6 @@ dcc_telnet_pass(int idx, int atr)
 
       dprintf(-dcc[idx].sock, "neg? %s %s\n", rand, buf);
     } else {
-      //bots dont need this
-      dcc[idx].u.chat = (struct chat_info *) my_calloc(1, sizeof(struct chat_info));
-      strcpy(dcc[idx].u.chat->con_chan, chanset ? chanset->dname : "*");
-
       /* Turn off remote telnet echo (send IAC WILL ECHO). */
       dprintf(idx, "\n%s" TLN_IAC_C TLN_WILL_C TLN_ECHO_C "\n", DCC_ENTERPASS);
     }