Skip to content
Snippets Groups Projects
Commit c3a69278 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

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

parent 1d718296
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment