r1301: Fix bogus error message when using "mangling method = hash" rather
authorJeremy Allison <jra@samba.org>
Tue, 29 Jun 2004 20:41:29 +0000 (20:41 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:05 +0000 (10:52 -0500)
than hash2. We are already calculating lengths so just use memcpy
not safe_strcpy().
Jeremy.

source/smbd/mangle_hash.c

index 7b8cbdbddba76bd328ccc1ee3cac1f4fe2ad5df3..d7239b82a79a349dcba855b69e10fecba58218c2 100644 (file)
@@ -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 );
 }