From: Jeremy Allison Date: Fri, 23 Mar 2007 17:00:00 +0000 (+0000) Subject: r21947: Fix the equivalent of memcpy(x, x, 16). Found X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~869 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6eed92dfd4da1f9979831bec8e0dcdee33fb53b4;p=thirdparty%2Fsamba.git r21947: Fix the equivalent of memcpy(x, x, 16). Found by valgrind on the build farm. Jeremy. --- diff --git a/source/libsmb/credentials.c b/source/libsmb/credentials.c index 76fc5fc0621..3243719d5c9 100644 --- a/source/libsmb/credentials.c +++ b/source/libsmb/credentials.c @@ -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);