From 521f6cfda933541af2e6a933e8c970f77dee9833 Mon Sep 17 00:00:00 2001
From: Hallvard Furuseth <hallvard@openldap.org>
Date: Sun, 27 Dec 1998 02:15:08 +0000
Subject: [PATCH] Change overlapping `strcpy( x, y )' to `SAFEMEMCPY( x, y,
 strlen( y ) + 1 )'

---
 clients/tools/ldapmodify.c | 2 +-
 libraries/libldap/ufn.c    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c
index d634274674..96a667ff11 100644
--- a/clients/tools/ldapmodify.c
+++ b/clients/tools/ldapmodify.c
@@ -423,7 +423,7 @@ process_ldapmod_rec( char *rbuf )
 	    rbuf = NULL;
 	} else {
 	    if ( *(p-1) == '\\' ) {	/* lines ending in '\' are continued */
-		strcpy( p - 1, p );
+		SAFEMEMCPY( p - 1, p, strlen( p ) + 1 );
 		rbuf = p;
 		continue;
 	    }
diff --git a/libraries/libldap/ufn.c b/libraries/libldap/ufn.c
index d56dc5799d..b2c34aee80 100644
--- a/libraries/libldap/ufn.c
+++ b/libraries/libldap/ufn.c
@@ -97,7 +97,8 @@ ldap_ufn_search_ctx( LDAP *ld, char **ufncomp, int ncomp, char *prefix,
 
 			if ( (quote = strrchr( ufncomp[ncomp], '"' )) != NULL )
 				*quote = '\0';
-			strcpy( ufncomp[ncomp], ufncomp[ncomp] + 1 );
+			SAFEMEMCPY( ufncomp[ncomp], ufncomp[ncomp] + 1,
+				    strlen( ufncomp[ncomp] + 1 ) + 1 );
 		}
 		if ( ncomp == 0 )
 			phase = 3;
-- 
GitLab