Change overlapping strcpy( x, y )' to SAFEMEMCPY( x, y, strlen( y ) + 1 )'

This commit is contained in:
Hallvard Furuseth 1998-12-27 02:00:08 +00:00
parent 1d718296b4
commit c3a692787c
4 changed files with 6 additions and 6 deletions

View File

@ -905,7 +905,7 @@ time2text( char *ldtimestr, int dateonly )
timestr[ strlen( timestr ) - 1 ] = zone; /* replace trailing newline */
if ( dateonly ) {
strcpy( timestr + 11, timestr + 20 );
SAFEMEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 );
}
return( timestr );

View File

@ -484,11 +484,11 @@ strtok_quote( char *line, char *sep )
} else {
inquote = 1;
}
strcpy( next, next + 1 );
SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 );
break;
case '\\':
strcpy( next, next + 1 );
SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 );
break;
default:

View File

@ -315,7 +315,7 @@ de_crypt( char *s )
char *p;
if ( strncmp( s, "{CRYPT}", 7 ) == 0 ) {
strcpy( s, s + 7 ); /* strip off "{CRYPT}" */
SAFEMEMCPY( s, s + 7, strlen( s + 7 ) + 1 ); /* strip off "{CRYPT}" */
for ( p = s; *p != '\0'; ++p) { /* "decrypt" each byte */
if ( *p != CRYPT_MASK ) {

View File

@ -173,11 +173,11 @@ strtok_quote(
} else {
inquote = 1;
}
strcpy( next, next + 1 );
SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 );
break;
case '\\':
strcpy( next, next + 1 );
SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 );
break;
default: