diff options
author | Jeremy Allison <jra@samba.org> | 2003-05-31 01:48:59 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-05-31 01:48:59 +0000 |
commit | 1fdbe30685501362fc90bdd968453f726e18c6eb (patch) | |
tree | 2a49478fb62a003e70e0eaaefe22ad9b2d254e01 /source3/smbd/connection.c | |
parent | 974d402d6dec202109a3fb7896e52581ebb5d4ad (diff) | |
download | samba-1fdbe30685501362fc90bdd968453f726e18c6eb.tar.gz samba-1fdbe30685501362fc90bdd968453f726e18c6eb.tar.xz samba-1fdbe30685501362fc90bdd968453f726e18c6eb.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.
(This used to be commit 7dfcf714ae2e81fece489640e2341f132c9f567d)
Diffstat (limited to 'source3/smbd/connection.c')
-rw-r--r-- | source3/smbd/connection.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c index 5547309a818..92aaebab1f4 100644 --- a/source3/smbd/connection.c +++ b/source3/smbd/connection.c @@ -41,6 +41,13 @@ static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *p pkey->pid = sys_getpid(); pkey->cnum = conn?conn->cnum:-1; fstrcpy(pkey->name, name); +#ifdef DEVELOPER + { + size_t sl = strlen(pkey->name); + if (sizeof(fstring)-sl) + memset(&pkey->name[sl], '\0', sizeof(fstring)-sl); + } +#endif pkbuf->dptr = (char *)pkey; pkbuf->dsize = sizeof(*pkey); |