فهرست منبع

* Bots no longer die when receiving a corrupt userfile under some conditions


svn: 3622
Bryan Drewery 18 سال پیش
والد
کامیت
f7ad5284b9
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 1 0
      doc/UPDATES
  2. 6 3
      src/users.c

+ 1 - 0
doc/UPDATES

@@ -69,6 +69,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fix ambiguous warning when a bot tries linking after being added with +user (fixes #383)
 * Add set 'irc-autoaway' to be able to disable autoaway feature. (addresses #380)
 * Fix an automatic hostmask bug (fixes #339)
+* Bots no longer die when receiving a corrupt userfile under some conditions
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 6 - 3
src/users.c

@@ -594,10 +594,13 @@ int readuserfile(const char *file, struct userrec **ret)
   simple_snprintf(s, 180, "%s", temps);
   free(temps);
   if (s[1] < '4') {
-    fatal("Empty or malformed userfile.", 0);
+    putlog(LOG_MISC, "*", "!*! Empty or malformed userfile.");
+    return 0;
+  }
+  if (s[1] > '4') {
+    putlog(LOG_MISC, "*", "Invalid userfile format.");
+    return 0;
   }
-  if (s[1] > '4')
-    fatal("Invalid userfile format.", 0);
   while (!feof(f)) {
     s = buf;
     fgets(cbuf, 1024, f);