r21947: Fix the equivalent of memcpy(x, x, 16). Found
authorJeremy Allison <jra@samba.org>
Fri, 23 Mar 2007 17:00:00 +0000 (17:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:51 +0000 (12:18 -0500)
by valgrind on the build farm.
Jeremy.

source/libsmb/credentials.c

index 76fc5fc062127d641af3a2ce53220eec03d63647..3243719d5c9da0e8d0d4c2d510ac276e241bc62d 100644 (file)
@@ -101,7 +101,9 @@ static void creds_init_64(struct dcinfo *dc,
        unsigned char sum2[8];
 
        /* Just in case this isn't already there */
-       memcpy(dc->mach_pw, mach_pw, 16);
+       if (dc->mach_pw != mach_pw) {
+               memcpy(dc->mach_pw, mach_pw, 16);
+       }
 
        sum[0] = IVAL(clnt_chal_in->data, 0) + IVAL(srv_chal_in->data, 0);
        sum[1] = IVAL(clnt_chal_in->data, 4) + IVAL(srv_chal_in->data, 4);