2114697ef0
from William Yodlowsky (MAINTAINER)
49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
$OpenBSD: patch-ktcheck_c,v 1.3 2007/09/04 20:52:13 jasper Exp $
|
|
--- ktcheck.c.orig Mon Jun 18 15:25:46 2007
|
|
+++ ktcheck.c Wed Jul 18 10:32:55 2007
|
|
@@ -238,7 +238,7 @@ clean_client_dir( void )
|
|
* can't pass in kdir, since it has a trailing slash.
|
|
* bounds checking done when creating kdir in main().
|
|
*/
|
|
- strcpy( dir, kdir );
|
|
+ (void)strlcpy( dir, kdir, sizeof( dir ) );
|
|
if (( p = strrchr( dir, '/' )) != NULL ) {
|
|
*p = '\0';
|
|
}
|
|
@@ -282,7 +282,7 @@ getstat( SNET *sn, char *description, char *stats )
|
|
fprintf( stderr, "%s: line too long\n", line );
|
|
return( -1 );
|
|
}
|
|
- strcpy( stats, line );
|
|
+ (void)strlcpy( stats, line, MAXPATHLEN );
|
|
|
|
if ( verbose ) printf( "<<< %s\n", stats );
|
|
|
|
@@ -433,7 +433,7 @@ check( SNET *sn, char *type, char *file )
|
|
fprintf( stderr, "%s: too long\n", type );
|
|
return( 2 );
|
|
}
|
|
- strcpy( pathdesc, type );
|
|
+ (void)strlcpy( pathdesc, type, sizeof( pathdesc ) );
|
|
|
|
file = base_kfile;
|
|
|
|
@@ -442,7 +442,7 @@ check( SNET *sn, char *type, char *file )
|
|
fprintf( stderr, "%s: path too long\n", base_kfile );
|
|
return( 2 );
|
|
}
|
|
- strcpy( path, base_kfile );
|
|
+ (void)strlcpy( path, base_kfile, sizeof( path ) );
|
|
}
|
|
|
|
if ( getstat( sn, (char *)&pathdesc, stats ) != 0 ) {
|
|
@@ -705,7 +705,7 @@ main( int argc, char **argv )
|
|
p++;
|
|
*p = (char)'\0';
|
|
}
|
|
- strcpy( path, base_kfile );
|
|
+ (void)strlcpy( path, base_kfile, sizeof( path ) );
|
|
|
|
if (( sn = connectsn( host, port )) == NULL ) {
|
|
exit( 2 );
|