$OpenBSD: patch-lapply_c,v 1.5 2007/09/09 20:02:09 jasper Exp $ --- lapply.c.orig Tue Jul 31 04:55:36 2007 +++ lapply.c Sun Sep 9 21:59:53 2007 @@ -85,7 +85,7 @@ create_node( char *path, char *tline ) new_node = (struct node *) malloc( sizeof( struct node )); new_node->path = strdup( path ); if ( tline != NULL ) { - sprintf( new_node->tline, "%s", tline ); + (void)snprintf( new_node->tline, sizeof( new_node->tline ), "%s", tline ); new_node->doline = 1; } else { new_node->doline = 0; @@ -129,7 +129,7 @@ do_line( char *tline, int present, struct stat *st, SN fprintf( stderr, "line %d: too long\n", linenum ); return( 1 ); } - strcpy( path, d_path ); + (void)strlcpy( path, d_path, sizeof( path ) ); /* DOWNLOAD */ if ( *command == '+' ) { @@ -138,7 +138,7 @@ do_line( char *tline, int present, struct stat *st, SN linenum, *targv[ 0 ] ); return( 1 ); } - strcpy( cksum_b64, targv[ 7 ] ); + (void)strlcpy( cksum_b64, targv[ 7 ], sizeof( cksum_b64 ) ); if ( special ) { if ( snprintf( pathdesc, MAXPATHLEN * 2, "SPECIAL %s", @@ -473,7 +473,7 @@ main( int argc, char **argv ) fprintf( stderr, "line %d: too long\n", linenum ); goto error2; } - strcpy( targvline, tline ); + (void)strlcpy( targvline, tline, sizeof( targvline ) ); tac = acav_parse( acav, targvline, &targv ); @@ -483,7 +483,7 @@ main( int argc, char **argv ) } if ( tac == 1 ) { - strcpy( transcript, targv[ 0 ] ); + (void)strlcpy( transcript, targv[ 0 ], sizeof( transcript ) ); len = strlen( transcript ); if ( transcript[ len - 1 ] != ':' ) { fprintf( stderr, "%s: line %d: invalid transcript name\n", @@ -525,7 +525,7 @@ main( int argc, char **argv ) fprintf( stderr, "line %d: too long\n", linenum ); return( 1 ); } - strcpy( path, d_path ); + (void)strlcpy( path, d_path, sizeof( path ) ); /* Check transcript order */ if ( prepath != 0 ) { @@ -539,7 +539,7 @@ main( int argc, char **argv ) transcript, linenum ); goto error2; } - strcpy( prepath, path ); + (void)strlcpy( prepath, path, sizeof( prepath ) ); /* Do type check on local file */ switch ( radstat( path, &st, &fstype, &afinfo )) {