ITS#2010: use snprintf instead of strcpy to prevent buffer overflow

This commit is contained in:
Kurt Zeilenga 2002-08-06 19:31:00 +00:00
parent 3f2faa1a84
commit f1047b704e

View file

@ -185,7 +185,7 @@ filecheck(
char *p;
unsigned int ret = 0;
strcpy( dir, f );
snprintf( dir, sizeof dir, "%s", f );
p = strrchr( dir, LDAP_DIRSEP[0] );
if ( p != NULL ) {
*p = '\0';