Jelajahi Sumber

* Fix auth IRC lookups getting the wrong cached idx

Bryan Drewery 16 tahun lalu
induk
melakukan
c1b9fe7edc
2 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 2 0
      doc/UPDATES
  2. 4 0
      src/auth.c

+ 2 - 0
doc/UPDATES

@@ -1,3 +1,5 @@
+* Fix auth IRC lookups getting the wrong cached idx
+
 1.3 - http://wraith.botpack.net/milestone/1.3
 * Binary / shell / startup changes
   * Binary error messages are no longer obscure numbers or fake segfaults. (Compile with OBSCURE_ERRORS to re-enable)

+ 4 - 0
src/auth.c

@@ -183,6 +183,10 @@ sdprintf(STR("GETIDX: auth: %s, idx: %d"), nick, idx);
   if (idx != -1) {
     if (!valid_idx(idx))
       idx = -1;
+    else if (!dcc[idx].irc || dcc[idx].simul == -1)
+      idx = -1;
+    else if (strcmp(dcc[idx].nick, handle))
+      idx = -1;
     else {
       sdprintf(STR("FIRST FOUND: %d"), idx);
       strlcpy(dcc[idx].simulbot, nick, sizeof(dcc[idx].simulbot));