From: Hallvard Furuseth Date: Sun, 27 Dec 1998 02:00:08 +0000 (+0000) Subject: Change overlapping `strcpy( x, y )' to `SAFEMEMCPY( x, y, strlen( y ) + 1 )' X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~863 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c3a692787c4c5f31feaddf289e2735cd723501b7;p=openldap Change overlapping `strcpy( x, y )' to `SAFEMEMCPY( x, y, strlen( y ) + 1 )' --- diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index 94cc00c139..d815cfb954 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -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 ); diff --git a/servers/slapd/config.c b/servers/slapd/config.c index e5fa3bca6f..d56881a836 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -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: diff --git a/servers/slapd/tools/ldapsyntax.c b/servers/slapd/tools/ldapsyntax.c index 421f4fcd00..2495e4db22 100644 --- a/servers/slapd/tools/ldapsyntax.c +++ b/servers/slapd/tools/ldapsyntax.c @@ -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 ) { diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index 43a4bcd90b..47d8fb419a 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -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: