2114697ef0
from William Yodlowsky (MAINTAINER)
67 lines
2.2 KiB
Plaintext
67 lines
2.2 KiB
Plaintext
$OpenBSD: patch-lapply_c,v 1.4 2007/09/04 20:52:13 jasper Exp $
|
|
--- lapply.c.orig Mon Jun 18 15:25:46 2007
|
|
+++ lapply.c Wed Jul 18 09:41:16 2007
|
|
@@ -84,7 +84,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;
|
|
@@ -128,7 +128,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 == '+' ) {
|
|
@@ -137,7 +137,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",
|
|
@@ -463,7 +463,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 );
|
|
|
|
@@ -473,7 +473,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",
|
|
@@ -515,7 +515,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 ) {
|
|
@@ -530,7 +530,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 )) {
|