]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
- replaced a lot of strcpy() calls with strlcpy() which is more secure.
[ngircd-alex.git] / src / ngircd / conf.c
index 7ad9ddd7c54d52c5eaf390a3f780703c1032cb95..50c9ee1b2c6c764eb1098a1651ed1c26d1d20646 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: conf.c,v 1.49 2002/12/26 16:25:43 alex Exp $";
+static char UNUSED id[] = "$Id: conf.c,v 1.51 2002/12/26 17:04:54 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -178,8 +178,8 @@ Set_Defaults( VOID )
        strcpy( Conf_ServerAdmin2, "" );
        strcpy( Conf_ServerAdminMail, "" );
 
-       strcpy( Conf_MotdFile, SYSCONFDIR );
-       strcat( Conf_MotdFile, MOTD_FILE );
+       strlcpy( Conf_MotdFile, SYSCONFDIR, sizeof( Conf_MotdFile ));
+       strlcat( Conf_MotdFile, MOTD_FILE, sizeof( Conf_MotdFile ));
 
        Conf_ListenPorts_Count = 0;
 
@@ -235,7 +235,7 @@ Read_Config( VOID )
                /* Is this the beginning of a new section? */
                if(( str[0] == '[' ) && ( str[strlen( str ) - 1] == ']' ))
                {
-                       strcpy( section, str );
+                       strlcpy( section, str, sizeof( section ));
                        if( strcasecmp( section, "[GLOBAL]" ) == 0 ) continue;
                        if( strcasecmp( section, "[OPERATOR]" ) == 0 )
                        {