Przeglądaj źródła

* Fixed CPU lockup for bots which did not have NODENAME/USERNAME/SYSNAME entries filled out.

svn: 2227
Bryan Drewery 21 lat temu
rodzic
commit
9cdcf98b6d
2 zmienionych plików z 11 dodań i 3 usunięć
  1. 1 0
      doc/UPDATES
  2. 10 3
      src/dcc.c

+ 1 - 0
doc/UPDATES

@@ -22,6 +22,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed bot's not being able to link when the botnick case did not match (userlist vs binary -C).
 * Fixed bot's not being able to link when the botnick case did not match (userlist vs binary -C).
 * cmd_nopass when given any argument will give random passes to users with no password. (#114)
 * cmd_nopass when given any argument will give random passes to users with no password. (#114)
 * Fixed a small cosmetic error with displaying bot info in whois.
 * Fixed a small cosmetic error with displaying bot info in whois.
+* Fixed CPU lockup for bots which did not have NODENAME/USERNAME/SYSNAME entries filled out.
 
 
 1.2.3
 1.2.3
 
 

+ 10 - 3
src/dcc.c

@@ -132,10 +132,17 @@ send_sysinfo()
   sysname = (char *) get_user(&USERENTRY_OS, conf.bot->u);
   sysname = (char *) get_user(&USERENTRY_OS, conf.bot->u);
   nodename = (char *) get_user(&USERENTRY_NODENAME, conf.bot->u);
   nodename = (char *) get_user(&USERENTRY_NODENAME, conf.bot->u);
 
 
+  const char *usysname = NULL, *uusername = NULL, *unodename = NULL;
 
 
-  if (egg_strcasecmp(sysname, gotun ? un.sysname : "*") ||
-      egg_strcasecmp(username, conf.username ? conf.username : "*") ||
-      egg_strcasecmp(nodename, gotun ? un.nodename : "*")) {
+  usysname = gotun ? un.sysname : "*";
+  uusername = conf.username ? conf.username : "*";
+  unodename = gotun ? un.nodename : "*";
+
+  if (((sysname && egg_strcasecmp(sysname, usysname)) ||
+      (username && egg_strcasecmp(username, uusername)) ||
+      (nodename && egg_strcasecmp(nodename, unodename))) ||
+      ((!sysname && usysname) || (!username && uusername) || (!nodename && unodename))
+      ) {
       char buf[201] = "";
       char buf[201] = "";
       size_t len = 0;
       size_t len = 0;