FW: [IRCServices] patch
Luciano Linhares Martins
lmartins at matrix.com.br
Sat Aug 12 08:45:22 PDT 2000
-----FW: <<A HREF="msg00707.html">20000812171819.A9719 at linux.kappa.ro</A>>-----
Date: Sat, 12 Aug 2000 17:18:19 +0300
Sender: owner-ircservices at ender.shadowfire.org
From: Mircea Damian <dmircea at linux.kappa.ro>
To: ircservices at Delirious.shadowfire.org
Subject: [IRCServices] patch
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.
--------------End of forwarded message-------------------------
----------------------------------
Luciano Linhares Martins
Date: 12-Aug-2000
Time: 12:45:09
<A HREF="http://users.matrix.com.br/lmartins">http://users.matrix.com.br/lmartins</A>
----------------------------------
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.