svn commit: samba r20368 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_24/source/smbd

jra at samba.org jra at samba.org
Wed Dec 27 23:52:49 GMT 2006


Author: jra
Date: 2006-12-27 23:52:47 +0000 (Wed, 27 Dec 2006)
New Revision: 20368

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

Log:
Fix valgrind report of uninitialized memory 
being returned (false positive). Up debug
level on "open_directory" message.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/negprot.c
   branches/SAMBA_3_0_24/source/smbd/negprot.c
   branches/SAMBA_3_0_24/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/negprot.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/negprot.c	2006-12-27 22:33:10 UTC (rev 20367)
+++ branches/SAMBA_3_0/source/smbd/negprot.c	2006-12-27 23:52:47 UTC (rev 20368)
@@ -174,6 +174,9 @@
 	DATA_BLOB blob;
 	nstring dos_name;
 	fstring unix_name;
+#ifdef DEVELOPER
+	size_t slen;
+#endif
 	char guid[17];
 	const char *OIDs_krb5[] = {OID_KERBEROS5,
 				   OID_KERBEROS5_OLD,
@@ -183,13 +186,21 @@
 
 	global_spnego_negotiated = True;
 
-	ZERO_STRUCT(guid);
+	memset(guid, '\0', sizeof(guid));
 
 	safe_strcpy(unix_name, global_myname(), sizeof(unix_name)-1);
 	strlower_m(unix_name);
 	push_ascii_nstring(dos_name, unix_name);
 	safe_strcpy(guid, dos_name, sizeof(guid)-1);
 
+#ifdef DEVELOPER
+	/* Fix valgrind 'uninitialized bytes' issue. */
+	slen = strlen(dos_name);
+	if (slen < sizeof(guid)) {
+		memset(guid+slen, '\0', sizeof(guid) - slen);
+	}
+#endif
+
 	/* strangely enough, NT does not sent the single OID NTLMSSP when
 	   not a ADS member, it sends no OIDs at all
 

Modified: branches/SAMBA_3_0_24/source/smbd/negprot.c
===================================================================
--- branches/SAMBA_3_0_24/source/smbd/negprot.c	2006-12-27 22:33:10 UTC (rev 20367)
+++ branches/SAMBA_3_0_24/source/smbd/negprot.c	2006-12-27 23:52:47 UTC (rev 20368)
@@ -174,6 +174,9 @@
 	DATA_BLOB blob;
 	nstring dos_name;
 	fstring unix_name;
+#ifdef DEVELOPER
+	size_t slen;
+#endif
 	char guid[17];
 	const char *OIDs_krb5[] = {OID_KERBEROS5,
 				   OID_KERBEROS5_OLD,
@@ -183,13 +186,21 @@
 
 	global_spnego_negotiated = True;
 
-	ZERO_STRUCT(guid);
+	memset(guid, '\0', sizeof(guid));
 
 	safe_strcpy(unix_name, global_myname(), sizeof(unix_name)-1);
 	strlower_m(unix_name);
 	push_ascii_nstring(dos_name, unix_name);
 	safe_strcpy(guid, dos_name, sizeof(guid)-1);
 
+#ifdef DEVELOPER
+	/* Fix valgrind 'uninitialized bytes' issue. */
+	slen = strlen(dos_name);
+	if (slen < sizeof(guid)) {
+		memset(guid+slen, '\0', sizeof(guid) - slen);
+	}
+#endif
+
 	/* strangely enough, NT does not sent the single OID NTLMSSP when
 	   not a ADS member, it sends no OIDs at all
 

Modified: branches/SAMBA_3_0_24/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0_24/source/smbd/reply.c	2006-12-27 22:33:10 UTC (rev 20367)
+++ branches/SAMBA_3_0_24/source/smbd/reply.c	2006-12-27 23:52:47 UTC (rev 20368)
@@ -3815,7 +3815,7 @@
 				FILE_SHARE_NONE, /* Ignored for stat opens */
 				FILE_CREATE, 0, NULL, &fsp);
 
-	DEBUG(1, ("open_directory returned %s\n", nt_errstr(status)));
+	DEBUG(5, ("open_directory returned %s\n", nt_errstr(status)));
 
 	if (!NT_STATUS_IS_OK(status)) {
 



More information about the samba-cvs mailing list