Explorar o código

* Only check expected nick if provided

Bryan Drewery %!s(int64=17) %!d(string=hai) anos
pai
achega
0753bdc95a
Modificáronse 1 ficheiros con 9 adicións e 7 borrados
  1. 9 7
      src/dcc.c

+ 9 - 7
src/dcc.c

@@ -983,13 +983,15 @@ dcc_chat_pass(int idx, char *buf, int atr)
           return;
         }
 
-        const char *expected_nick = newsplit(&buf);
-
-        if (egg_strcasecmp(expected_nick, conf.bot->nick)) {
-          putlog(LOG_WARN, "*", STR("%s failed encrypted link handshake (was expecting '%s' instead of me)"), dcc[idx].nick, expected_nick);
-          killsock(dcc[idx].sock);
-          lostdcc(idx);
-          return;
+        if (buf[0]) {
+          const char *expected_nick = newsplit(&buf);
+
+          if (egg_strcasecmp(expected_nick, conf.bot->nick)) {
+            putlog(LOG_WARN, "*", STR("%s failed encrypted link handshake (was expecting '%s' instead of me)"), dcc[idx].nick, expected_nick);
+            killsock(dcc[idx].sock);
+            lostdcc(idx);
+            return;
+          }
         }
 
         socklist[snum].enclink = i;