[eggheads-patches] PATCH: chasegv.patch

Peter 'Rattacresh' Backes rtc at rhrk.uni-kl.de
Sat Oct 16 11:29:42 CST 1999


requires +cmall which inherited the buggy code to botattr which has 
also been fixed.
exactly '.chattr x +xxxxxxxxxxxxxxxxxxxxxxxxx #x' crashed any bot.


-- Peter 'Rattacresh' Backes, rtc at rhrk.uni-kl.de

-------------- next part --------------
diff -urN eggdrop1.3.29/doc/UPDATES1.3 eggdrop1.3.29+chasegv/doc/UPDATES1.3
--- eggdrop1.3.29/doc/UPDATES1.3	Sat Oct 16 17:20:29 1999
+++ eggdrop1.3.29+chasegv/doc/UPDATES1.3	Sat Oct 16 17:40:41 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          rtc       fixed SEGV in chattr
           Tothwolf  major configure/Makefile changes
           Cybah	    strncpy() being used on buffers without terminating them.
 Tothwolf  Fabian    stopped userfile parsing funcs from messing with ~ and `
diff -urN eggdrop1.3.29/src/cmds.c eggdrop1.3.29+chasegv/src/cmds.c
--- eggdrop1.3.29/src/cmds.c	Sat Oct 16 17:20:29 1999
+++ eggdrop1.3.29+chasegv/src/cmds.c	Sat Oct 16 17:30:51 1999
@@ -1474,8 +1474,9 @@
       }
     } else if (arg && !strpbrk(chg, "&|")) {
       context;
-      tmpchg = nmalloc(sizeof(chg)+1);
-      sprintf(tmpchg,"|%s",chg);
+      tmpchg = nmalloc(strlen(chg) + 2);
+      strcpy (tmpchg, "|");
+      strcat (tmpchg, chg);
       chg = tmpchg;
     }
   }
@@ -1666,8 +1667,9 @@
       }
     } else if (arg && !strpbrk(chg, "&|")) {
       context;
-      tmpchg = nmalloc(sizeof(chg)+1);
-      sprintf(tmpchg,"|%s",chg);
+      tmpchg = nmalloc(strlen(chg) + 2);
+      strcpy (tmpchg, "|");
+      strcat (tmpchg, chg);
       chg = tmpchg;
     }
   }


More information about the Patches mailing list