summaryrefslogtreecommitdiffstats
path: root/source/smbd/negprot.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-05-31 01:48:59 +0000
committerJeremy Allison <jra@samba.org>2003-05-31 01:48:59 +0000
commit7dfcf714ae2e81fece489640e2341f132c9f567d (patch)
treee6171805d5da4830d67c2f0689e679335c5f95b4 /source/smbd/negprot.c
parent685e4e518236079f201650f26152f6f9ad3c61ab (diff)
downloadsamba-7dfcf714ae2e81fece489640e2341f132c9f567d.tar.gz
samba-7dfcf714ae2e81fece489640e2341f132c9f567d.tar.xz
samba-7dfcf714ae2e81fece489640e2341f132c9f567d.zip
Fixes to stop valgrind complaining about uninitialised memory when it's
copying clobbered buffer areas and doing hashes on them and sending them onto the wire. Jeremy.
Diffstat (limited to 'source/smbd/negprot.c')
-rw-r--r--source/smbd/negprot.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/smbd/negprot.c b/source/smbd/negprot.c
index bd1b9b0d572..648801e9553 100644
--- a/source/smbd/negprot.c
+++ b/source/smbd/negprot.c
@@ -182,6 +182,15 @@ static int negprot_spnego(char *p)
ZERO_STRUCT(guid);
safe_strcpy((char *)guid, global_myname(), sizeof(guid)-1);
+
+#ifdef DEVELOPER
+ {
+ size_t sl = strlen(guid);
+ if (sizeof(guid)-sl)
+ memset(&guid[sl], '\0', sizeof(guid)-sl);
+ }
+#endif
+
strlower((char *)guid);
#if 0