$OpenBSD: patch-command_c,v 1.3 2007/04/01 07:08:39 steven Exp $
--- command.c.orig	Thu Feb 10 19:17:57 2005
+++ command.c	Sun Apr  1 08:18:32 2007
@@ -636,7 +636,7 @@ f_stat( SNET *sn, int ac, char *av[] )
 
 	/* if allowable, check for transcript in the special file directory */
 
-	strcat( path, ".T" );
+	(void)strlcat( path, ".T", sizeof( path ) );
 
 	/* store value of av[ 2 ], because argcargv will be called
 	 * from special_t(), and that will blow away the current values
@@ -745,7 +745,7 @@ f_stor( SNET *sn, int ac, char *av[] )
 	    snet_writef( sn, "%d Path too long\r\n", 540 );
 	    return( 1 );
 	}
-	strcpy( upload_xscript, av[ 2 ] );
+	(void)strlcpy( upload_xscript, av[ 2 ], sizeof( upload_xscript ) );
 
 	/* make the directory for the files of this xscript to live in. */
 	if ( mkdir( xscriptdir, 0777 ) < 0 ) {
@@ -1141,7 +1141,7 @@ command_k( char *path_config )
 	}
 
 	if (( p = strrchr( av[ 1 ], '/' )) == NULL ) {
-	    sprintf( special_dir, "special" );
+	    (void)snprintf( special_dir, sizeof( special_dir ), "special" );
 	} else {
 	    *p = '\0';
 	    if ( snprintf( special_dir, MAXPATHLEN, "special/%s", av[ 1 ] )
@@ -1159,14 +1159,14 @@ command_k( char *path_config )
 		    "config file: line %d: command file too long\n", linenum );
 		continue;
 	    }
-	    strcpy( command_file, av[ 1 ] );
+	    (void)strlcpy( command_file, av[ 1 ], sizeof( command_file ) );
 	    if ( snprintf( temp, MAXPATHLEN, "%s/%s", special_dir,
 		    remote_cn ) >= MAXPATHLEN ) {
 		syslog( LOG_ERR, "config file: line %d: special dir too long\n",
 		    linenum );
 		continue;
 	    }
-	    strcpy( special_dir, temp );
+	    (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
 	    return( 0 );
 	}
 	if ( wildcard( av[ 0 ], remote_host, 0 )) {
@@ -1175,14 +1175,14 @@ command_k( char *path_config )
 		    "config file: line %d: command file too long\n", linenum );
 		continue;
 	    }
-	    strcpy( command_file, av[ 1 ] );
+	    (void)strlcpy( command_file, av[ 1 ], sizeof( command_file ) );
 	    if ( snprintf( temp, MAXPATHLEN, "%s/%s", special_dir,
 		    remote_host ) >= MAXPATHLEN ) {
 		syslog( LOG_ERR, "config file: line %d: special dir too long\n",
 		    linenum );
 		continue;
 	    }
-	    strcpy( special_dir, temp );
+	    (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
 	    return( 0 );
 	} 
 	if ( wildcard( av[ 0 ], remote_addr, 1 )) {
@@ -1191,14 +1191,14 @@ command_k( char *path_config )
 		    "config file: line %d: command file too long\n", linenum );
 		continue;
 	    }
-	    strcpy( command_file, av[ 1 ] );
+	    (void)strlcpy( command_file, av[ 1 ], sizeof( command_file ) );
 	    if ( snprintf( temp, MAXPATHLEN, "%s/%s", special_dir,
 		    remote_addr ) >= MAXPATHLEN ) {
 		syslog( LOG_ERR, "config file: line %d: special dir too long\n",
 		    linenum );
 		continue;
 	    }
-	    strcpy( special_dir, temp );
+	    (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
 	    return( 0 );
 	} 
     }
