Index: AUTHORS =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/AUTHORS,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -r1.8.2.1 -r1.8.2.2 --- AUTHORS 7 May 2004 11:24:17 -0000 1.8.2.1 +++ AUTHORS 26 Jan 2005 13:26:41 -0000 1.8.2.2 @@ -1,7 +1,7 @@ ngIRCd - Next Generation IRC Server - (c)2001-2004 by Alexander Barton, + (c)2001-2005 Alexander Barton, alex@barton.de, http://www.barton.de/ ngIRCd is free software and published under the @@ -21,6 +21,7 @@ Ilja Osthoff, (ilja) Benjamin Pineau, Sean Reifschneider, +Florian Westphal, Code snippets @@ -31,4 +32,4 @@ -- -$Id: AUTHORS,v 1.8.2.1 2004/05/07 11:24:17 alex Exp $ +$Id: AUTHORS,v 1.8.2.2 2005/01/26 13:26:41 alex Exp $ Index: ChangeLog =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/ChangeLog,v retrieving revision 1.233.2.11 retrieving revision 1.233.2.17 diff -u -r1.233.2.11 -r1.233.2.17 --- ChangeLog 25 Dec 2004 00:20:57 -0000 1.233.2.11 +++ ChangeLog 26 Jan 2005 22:05:26 -0000 1.233.2.17 @@ -1,7 +1,7 @@ ngIRCd - Next Generation IRC Server - (c)2001-2004 by Alexander Barton, + (c)2001-2005 Alexander Barton, alex@barton.de, http://www.barton.de/ ngIRCd is free software and published under the @@ -10,6 +10,20 @@ -- ChangeLog -- +ngircd 0.8.2 (2005-01-26) + + - Added doc/SSL.txt to distribution. + - Fixed a buffer overflow that could cause the daemon to crash. Bug found + by Florian Westphal, . + - Fixed a possible buffer underrun when reading the MOTD file. Thanks + to Florian Westphal, . + - Fixed detection of IRC lines which are too long to send. Detected by + Florian Westphal, . + - Fixed return values of our own implementation of strlcpy(). The code has + been taken from rsync and they fixed it, but we didn't until today :-/ + It has only been used when the system didn't implement strlcpy by itself, + not on "modern" systems. Florian Westphal, . + ngircd 0.8.1 (2004-12-25) - Autoconf: Updated config.guess and config.sub @@ -540,4 +554,4 @@ -- -$Id: ChangeLog,v 1.233.2.11 2004/12/25 00:20:57 alex Exp $ +$Id: ChangeLog,v 1.233.2.17 2005/01/26 22:05:26 alex Exp $ Index: configure.in =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/configure.in,v retrieving revision 1.102.2.5 retrieving revision 1.102.2.6 diff -u -r1.102.2.5 -r1.102.2.6 --- configure.in 25 Dec 2004 00:20:57 -0000 1.102.2.5 +++ configure.in 26 Jan 2005 22:05:26 -0000 1.102.2.6 @@ -1,6 +1,6 @@ # # ngIRCd -- The Next Generation IRC Daemon -# Copyright (c)2001-2004 Alexander Barton +# Copyright (c)2001-2005 Alexander Barton # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -8,13 +8,13 @@ # (at your option) any later version. # Please read the file COPYING, README and AUTHORS for more information. # -# $Id: configure.in,v 1.102.2.5 2004/12/25 00:20:57 alex Exp $ +# $Id: configure.in,v 1.102.2.6 2005/01/26 22:05:26 alex Exp $ # # -- Initialisation -- AC_PREREQ(2.50) -AC_INIT(ngircd, 0.8.1) +AC_INIT(ngircd, 0.8.2) AC_CONFIG_SRCDIR(src/ngircd/ngircd.c) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(1.6) Index: contrib/ngircd.spec =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/contrib/ngircd.spec,v retrieving revision 1.4.2.4 retrieving revision 1.4.2.5 diff -u -r1.4.2.4 -r1.4.2.5 --- contrib/ngircd.spec 25 Dec 2004 00:20:57 -0000 1.4.2.4 +++ contrib/ngircd.spec 26 Jan 2005 22:05:26 -0000 1.4.2.5 @@ -1,5 +1,5 @@ %define name ngircd -%define version 0.8.1 +%define version 0.8.2 %define release 1 %define prefix %{_prefix} Index: contrib/Debian/changelog =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/contrib/Debian/changelog,v retrieving revision 1.8.2.4 retrieving revision 1.8.2.6 diff -u -r1.8.2.4 -r1.8.2.6 --- contrib/Debian/changelog 25 Dec 2004 00:20:57 -0000 1.8.2.4 +++ contrib/Debian/changelog 26 Jan 2005 22:18:48 -0000 1.8.2.6 @@ -1,3 +1,9 @@ +ngircd (0.8.2-0ab1) unstable; urgency=high + + * New "upstream release", including security fixes. + + -- alex Wed, 26 Jan 2005 23:14:12 +0100 + ngircd (0.8.1-0ab1) unstable; urgency=low * New "upstream release". Index: src/ngircd/conn.c =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/src/ngircd/conn.c,v retrieving revision 1.134.2.3 retrieving revision 1.134.2.4 diff -u -r1.134.2.3 -r1.134.2.4 --- src/ngircd/conn.c 25 Dec 2004 00:00:42 -0000 1.134.2.3 +++ src/ngircd/conn.c 19 Jan 2005 23:35:42 -0000 1.134.2.4 @@ -16,7 +16,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: conn.c,v 1.134.2.3 2004/12/25 00:00:42 alex Exp $"; +static char UNUSED id[] = "$Id: conn.c,v 1.134.2.4 2005/01/19 23:35:42 alex Exp $"; #include "imp.h" #include @@ -525,7 +525,7 @@ #else va_start( ap ); #endif - if( vsnprintf( buffer, COMMAND_LEN - 2, Format, ap ) == COMMAND_LEN - 2 ) + if( vsnprintf( buffer, COMMAND_LEN - 2, Format, ap ) >= COMMAND_LEN - 2 ) { Log( LOG_CRIT, "Text too long to send (connection %d)!", Idx ); Conn_Close( Idx, "Text too long to send!", NULL, FALSE ); Index: src/ngircd/irc-info.c =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/src/ngircd/irc-info.c,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -u -r1.21.2.1 -r1.21.2.2 --- src/ngircd/irc-info.c 7 May 2004 11:24:18 -0000 1.21.2.1 +++ src/ngircd/irc-info.c 24 Jan 2005 14:22:30 -0000 1.21.2.2 @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-info.c,v 1.21.2.1 2004/05/07 11:24:18 alex Exp $"; +static char UNUSED id[] = "$Id: irc-info.c,v 1.21.2.2 2005/01/24 14:22:30 alex Exp $"; #include "imp.h" #include @@ -770,6 +770,7 @@ BOOLEAN ok; CHAR line[127]; FILE *fd; + UINT line_len; assert( Client != NULL ); @@ -790,8 +791,12 @@ if( ! IRC_WriteStrClient( Client, RPL_MOTDSTART_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )))) return DISCONNECTED; while( TRUE ) { - if( ! fgets( line, 126, fd )) break; - if( line[strlen( line ) - 1] == '\n' ) line[strlen( line ) - 1] = '\0'; + if( ! fgets( line, sizeof( line ), fd )) break; + + line_len = strlen( line ); + if( line_len > 0 ) line_len--; + if( line[line_len] == '\n' ) line[line_len] = '\0'; + if( ! IRC_WriteStrClient( Client, RPL_MOTD_MSG, Client_ID( Client ), line )) { fclose( fd ); Index: src/ngircd/lists.c =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/src/ngircd/lists.c,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -r1.15 -r1.15.2.1 --- src/ngircd/lists.c 25 Apr 2004 15:40:19 -0000 1.15 +++ src/ngircd/lists.c 26 Jan 2005 13:27:01 -0000 1.15.2.1 @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * Copyright (c)2001-2005 Alexander Barton (alex@barton.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: lists.c,v 1.15 2004/04/25 15:40:19 alex Exp $"; +static char UNUSED id[] = "$Id: lists.c,v 1.15.2.1 2005/01/26 13:27:01 alex Exp $"; #include "imp.h" #include @@ -360,9 +360,10 @@ GLOBAL CHAR * Lists_MakeMask( CHAR *Pattern ) { - /* Hier wird aus einem "beliebigen" Pattern eine gueltige IRC-Mask erzeugt. - * Diese ist aber nur bis zum naechsten Aufruf von Lists_MakeMask() gueltig, - * da ein einziger globaler Puffer verwendet wird. ->Umkopieren!*/ + /* This function generats a valid IRC mask of "any" string. This + * mask is only valid until the next call to Lists_MakeMask(), + * because a single global buffer is used. You have to copy the + * generated mask to some sane location yourself! */ STATIC CHAR TheMask[MASK_LEN]; CHAR *excl, *at; @@ -376,7 +377,7 @@ if(( ! at ) && ( ! excl )) { - /* weder ! noch @ vorhanden: als Nick annehmen */ + /* Neither "!" nor "@" found: use string as nick name */ strlcpy( TheMask, Pattern, sizeof( TheMask ) - 5 ); strlcat( TheMask, "!*@*", sizeof( TheMask )); return TheMask; @@ -384,7 +385,7 @@ if(( ! at ) && ( excl )) { - /* Domain fehlt */ + /* Domain part is missing */ strlcpy( TheMask, Pattern, sizeof( TheMask ) - 3 ); strlcat( TheMask, "@*", sizeof( TheMask )); return TheMask; @@ -392,15 +393,15 @@ if(( at ) && ( ! excl )) { - /* User fehlt */ + /* User name is missing */ *at = '\0'; at++; - strlcpy( TheMask, Pattern, sizeof( TheMask ) - strlen( at ) - 4 ); + strlcpy( TheMask, Pattern, sizeof( TheMask ) - 5 ); strlcat( TheMask, "!*@", sizeof( TheMask )); strlcat( TheMask, at, sizeof( TheMask )); return TheMask; } - /* alle Teile vorhanden */ + /* All parts (nick, user and domain name) are given */ strlcpy( TheMask, Pattern, sizeof( TheMask )); return TheMask; } /* Lists_MakeMask */ Index: src/ngircd/ngircd.c =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/src/ngircd/ngircd.c,v retrieving revision 1.83.2.2 retrieving revision 1.83.2.3 diff -u -r1.83.2.2 -r1.83.2.3 --- src/ngircd/ngircd.c 15 May 2004 23:52:17 -0000 1.83.2.2 +++ src/ngircd/ngircd.c 26 Jan 2005 22:02:36 -0000 1.83.2.3 @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2004 by Alexander Barton (alex@barton.de) + * Copyright (c)2001-2005 by Alexander Barton (alex@barton.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: ngircd.c,v 1.83.2.2 2004/05/15 23:52:17 alex Exp $"; +static char UNUSED id[] = "$Id: ngircd.c,v 1.83.2.3 2005/01/26 22:02:36 alex Exp $"; #include "imp.h" #include @@ -545,7 +545,7 @@ Show_Version( VOID ) { puts( NGIRCd_Version( )); - puts( "Copyright (c)2001-2004 by Alexander Barton ()." ); + puts( "Copyright (c)2001-2005 by Alexander Barton ()." ); puts( "Homepage: \n" ); puts( "This is free software; see the source for copying conditions. There is NO" ); puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." ); Index: src/portab/strlcpy.c =================================================================== RCS file: /usr/local/CVS/ngircd/ngircd/src/portab/strlcpy.c,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -u -r1.2 -r1.2.4.1 --- src/portab/strlcpy.c 26 Dec 2002 14:34:11 -0000 1.2 +++ src/portab/strlcpy.c 18 Jan 2005 09:09:05 -0000 1.2.4.1 @@ -19,7 +19,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: strlcpy.c,v 1.2 2002/12/26 14:34:11 alex Exp $"; +static char UNUSED id[] = "$Id: strlcpy.c,v 1.2.4.1 2005/01/18 09:09:05 alex Exp $"; #include "imp.h" #include @@ -61,12 +61,13 @@ * always null terminates. */ size_t len = strlen( src ); + size_t ret = len; - if( size <= 0 ) return len; + if( size <= 0 ) return 0; if( len >= size ) len = size - 1; memcpy( dst, src, len ); dst[len] = 0; - return len; + return ret; } /* strlcpy */ #endif