CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_11_03
Commit time: 2002-11-27 04:31:00 UTC

Modified files:
  Tag: u2_10_11_03
     ircd/channel.c include/patchlevel.h ChangeLog

Log message:

- Do not access freed memory again. This should not be a security
  problem only a portability problem/a problem when debugging
  with efence. This would cause a core when FROBONFREE is defined.
- Bumped patchlevel so we can tell if a core is after this fix.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.290.2.125.2.25 ircu2.10/ChangeLog:1.290.2.125.2.26
--- ircu2.10/ChangeLog:1.290.2.125.2.25 Mon Nov 25 03:41:00 2002
+++ ircu2.10/ChangeLog  Tue Nov 26 20:30:49 2002
@@ -1,3 +1,7 @@
+2002-11-27  Andrew Miller <[EMAIL PROTECTED]>
+       * ircd/channel.c: Don't access memory after it is freed.
+       * include/patchlevel.h: Bump patchlevel again to stop confusion.
+       
 2002-11-26  Perry Lorier  <[EMAIL PROTECTED]>
        * include/patchlevel.h: Update version string
 
Index: ircu2.10/include/patchlevel.h
diff -u ircu2.10/include/patchlevel.h:1.10.4.61.2.2 
ircu2.10/include/patchlevel.h:1.10.4.61.2.3
--- ircu2.10/include/patchlevel.h:1.10.4.61.2.2 Mon Nov 25 03:41:00 2002
+++ ircu2.10/include/patchlevel.h       Tue Nov 26 20:30:49 2002
@@ -15,10 +15,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: patchlevel.h,v 1.10.4.61.2.2 2002/11/25 11:41:00 isomer Exp $
+ * $Id: patchlevel.h,v 1.10.4.61.2.3 2002/11/27 04:30:49 a1kmm Exp $
  *
  */
-#define PATCHLEVEL "03.(dev).5ish"
+#define PATCHLEVEL "03.(dev).5ish-2"
 
 #define RELEASE ".11."
 
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.73.2.10.4.6 ircu2.10/ircd/channel.c:1.73.2.10.4.7
--- ircu2.10/ircd/channel.c:1.73.2.10.4.6       Sat Nov 23 11:05:08 2002
+++ ircu2.10/ircd/channel.c     Tue Nov 26 20:30:49 2002
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: channel.c,v 1.73.2.10.4.6 2002/11/23 19:05:08 klmitch Exp $
+ * $Id: channel.c,v 1.73.2.10.4.7 2002/11/27 04:30:49 a1kmm Exp $
  */
 #include "config.h"
 
@@ -2650,6 +2650,7 @@
 joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags)
 {
   unsigned int len;
+  int is_local;
 
   assert(0 != jbuf);
 
@@ -2660,6 +2661,8 @@
     return;
   }
 
+  is_local = IsLocalChannel(chan->chname);
+
   if (jbuf->jb_type == JOINBUF_TYPE_PART ||
       jbuf->jb_type == JOINBUF_TYPE_PARTALL) {
     /* Send notification to channel */
@@ -2678,8 +2681,8 @@
      * exactly the same logic, albeit somewhat more concise, as was in
      * the original m_part.c */
 
-    if (jbuf->jb_type == JOINBUF_TYPE_PARTALL ||
-       IsLocalChannel(chan->chname)) /* got to remove user here */
+    /* got to remove user here */
+    if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || is_local)
       remove_user_from_channel(jbuf->jb_source, chan);
   } else {
     /* Add user to channel */
@@ -2700,7 +2703,8 @@
   }
 
   if (jbuf->jb_type == JOINBUF_TYPE_PARTALL ||
-      jbuf->jb_type == JOINBUF_TYPE_JOIN || IsLocalChannel(chan->chname))
+      jbuf->jb_type == JOINBUF_TYPE_JOIN ||
+      is_local)
     return; /* don't send to remote */
 
   /* figure out if channel name will cause buffer to be overflowed */
----------------------- End of diff -----------------------

Reply via email to