svn commit: samba r21947 - in branches: SAMBA_3_0/source/libsmb SAMBA_3_0_25/source/libsmb

jra at samba.org jra at samba.org
Fri Mar 23 17:00:01 GMT 2007


Author: jra
Date: 2007-03-23 17:00:00 +0000 (Fri, 23 Mar 2007)
New Revision: 21947

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21947

Log:
Fix the equivalent of memcpy(x, x, 16). Found
by valgrind on the build farm.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/libsmb/credentials.c
   branches/SAMBA_3_0_25/source/libsmb/credentials.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/credentials.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/credentials.c	2007-03-23 16:28:14 UTC (rev 21946)
+++ branches/SAMBA_3_0/source/libsmb/credentials.c	2007-03-23 17:00:00 UTC (rev 21947)
@@ -101,7 +101,9 @@
 	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);

Modified: branches/SAMBA_3_0_25/source/libsmb/credentials.c
===================================================================
--- branches/SAMBA_3_0_25/source/libsmb/credentials.c	2007-03-23 16:28:14 UTC (rev 21946)
+++ branches/SAMBA_3_0_25/source/libsmb/credentials.c	2007-03-23 17:00:00 UTC (rev 21947)
@@ -101,7 +101,9 @@
 	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);



More information about the samba-cvs mailing list