From b04c782281bcb6a9b13168dacdae59898dd9fe7f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 29 Jun 2004 20:41:29 +0000 Subject: r1301: Fix bogus error message when using "mangling method = hash" rather than hash2. We are already calculating lengths so just use memcpy not safe_strcpy(). Jeremy. (This used to be commit a5a3df78531dc5400088e1746d6a7cd29f56a714) --- source3/smbd/mangle_hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c index 7b8cbdbddb..d7239b82a7 100644 --- a/source3/smbd/mangle_hash.c +++ b/source3/smbd/mangle_hash.c @@ -546,8 +546,10 @@ static void cache_mangled_name( char *mangled_name, char *raw_name ) /* Fill the new cache entry, and add it to the cache. */ s1 = (char *)(new_entry + 1); s2 = (char *)&(s1[mangled_len + 1]); - safe_strcpy( s1, mangled_name, mangled_len ); - safe_strcpy( s2, raw_name, raw_len ); + memcpy( s1, mangled_name, mangled_len ); + s1[mangled_len] = '\0'; + memcpy( s2, raw_name, raw_len ); + s2[raw_len] = '\0'; ubi_cachePut( mangled_cache, i, new_entry, s1 ); } -- cgit