[IRCServices] patch

Mircea Damian dmircea at linux.kappa.ro
Sat Aug 12 07:18:19 PDT 2000


Hello,

Here is a small patch against the latest version of ircservices (4.4.5)
which fixes two things:

- password encryption when compiled with gcc-2.7.2.x: the problem is that
  the buffers need to be initialized to 0 and by default they are full of
  garbage

- fix a possible smalloc(0) in sessions.c when it reads the exceptions
  which is possible to be an empty => nexceptions = 0 => smalloc(0);
  obviuous solution was to move smalloc after the check


diff -r -u ircservices-4.4.5-clean/encrypt.c ircservices-4.4.5/encrypt.c
--- ircservices-4.4.5-clean/encrypt.c   Sat Jan 29 07:17:51 2000
+++ ircservices-4.4.5/encrypt.c Wed Aug  9 17:35:48 2000
@@ -356,6 +356,11 @@
 
     if (size < 16)
        return -1;
+
+    memset(&context, 0, sizeof(context));
+    memset(&digest, 0, sizeof(digest));
+
+    
     MD5Init(&context);
     MD5Update(&context, src, len);
     MD5Final(digest, &context);
diff -r -u ircservices-4.4.5-clean/sessions.c ircservices-4.4.5/sessions.c
--- ircservices-4.4.5-clean/sessions.c  Wed Mar 15 09:15:01 2000
+++ ircservices-4.4.5/sessions.c        Wed Aug  9 17:30:22 2000
@@ -381,11 +381,11 @@
       case 7:
         SAFE(read_int16(&n, f));
         nexceptions = n;
-        exceptions = smalloc(sizeof(Exception) * nexceptions);
         if (!nexceptions) {
             close_db(f);
             return;
         }
+        exceptions = smalloc(sizeof(Exception) * nexceptions);
         for (i = 0; i < nexceptions; i++) {
             SAFE(read_string(&exceptions[i].mask, f));
             SAFE(read_int16(&tmp16, f));

-- 
Mircea Damian
E-mails: dmircea at kappa.ro, dmircea at roedu.net
WebPage: http://taz.mania.k.ro/~dmircea/

---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.