diff options
author | Jeremy Allison <jra@samba.org> | 2006-12-27 23:52:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:44 -0500 |
commit | 2703b3ac480b1c29684b13297f5e78481c889223 (patch) | |
tree | ac9dff2f2ff35596ec4afd4be25c17c1234754f2 | |
parent | b26a9ad9dfe2976ae1f6c31b270bdcd7818172c3 (diff) | |
download | samba-2703b3ac480b1c29684b13297f5e78481c889223.tar.gz samba-2703b3ac480b1c29684b13297f5e78481c889223.tar.bz2 samba-2703b3ac480b1c29684b13297f5e78481c889223.zip |
r20368: Fix valgrind report of uninitialized memory
being returned (false positive). Up debug
level on "open_directory" message.
Jeremy.
(This used to be commit 71a8b8863f8bdcce082c5971d6489a2da3ff4b2c)
-rw-r--r-- | source3/smbd/negprot.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 8e9dcf22e2..fec5971045 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -174,6 +174,9 @@ static DATA_BLOB negprot_spnego(void) 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 @@ static DATA_BLOB negprot_spnego(void) 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 |