]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/ngircd.c
- replaced a lot of strcat() calls with strlcat() which is more secure.
[ngircd-alex.git] / src / ngircd / ngircd.c
index 92f1a3e2e131019dc960a58292d7f4da6530a2e4..cef1cff58d5b6690b03b3dfdcfdb027aa33134d4 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: ngircd.c,v 1.67 2002/12/26 16:25:43 alex Exp $";
+static char UNUSED id[] = "$Id: ngircd.c,v 1.68 2002/12/26 16:48:14 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
 
 #include "imp.h"
 #include <assert.h>
@@ -73,8 +73,8 @@ main( int argc, const char *argv[] )
 #ifdef SNIFFER
        NGIRCd_Sniffer = FALSE;
 #endif
 #ifdef SNIFFER
        NGIRCd_Sniffer = FALSE;
 #endif
-       strcpy( NGIRCd_ConfFile, SYSCONFDIR );
-       strcat( NGIRCd_ConfFile, CONFIG_FILE );
+       strlcpy( NGIRCd_ConfFile, SYSCONFDIR, sizeof( NGIRCd_ConfFile ));
+       strlcat( NGIRCd_ConfFile, CONFIG_FILE, sizeof( NGIRCd_ConfFile ));
 
        /* Kommandozeile parsen */
        for( i = 1; i < argc; i++ )
 
        /* Kommandozeile parsen */
        for( i = 1; i < argc; i++ )
@@ -376,12 +376,12 @@ NGIRCd_VersionAddition( VOID )
        strcat( txt, "IRCPLUS" );
 #endif
        
        strcat( txt, "IRCPLUS" );
 #endif
        
-       if( txt[0] ) strcat( txt, "-" );
-       strcat( txt, TARGET_CPU );
-       strcat( txt, "/" );
-       strcat( txt, TARGET_VENDOR );
-       strcat( txt, "/" );
-       strcat( txt, TARGET_OS );
+       if( txt[0] ) strlcat( txt, "-", sizeof( txt ));
+       strlcat( txt, TARGET_CPU, sizeof( txt ));
+       strlcat( txt, "/", sizeof( txt ));
+       strlcat( txt, TARGET_VENDOR, sizeof( txt ));
+       strlcat( txt, "/", sizeof( txt ));
+       strlcat( txt, TARGET_OS, sizeof( txt ));
 
        return txt;
 } /* NGIRCd_VersionAddition */
 
        return txt;
 } /* NGIRCd_VersionAddition */