mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-09 02:52:04 +08:00
Change overlapping strcpy( x, y )' to
SAFEMEMCPY( x, y, strlen( y ) + 1 )'
This commit is contained in:
parent
1d718296b4
commit
c3a692787c
@ -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 );
|
||||
|
@ -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:
|
||||
|
@ -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 ) {
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user