From 0899066fd6afc0fa8617d9e8c6dc5f6a7ece1dc5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 31 May 2003 02:03:58 +0000 Subject: Got us happy running under valgrind again :-). Jeremy. (This used to be commit b6ab9d73610861d225d72845d4df7cf970155e39) --- source3/smbd/connection.c | 1 + source3/smbd/negprot.c | 1 + source3/smbd/trans2.c | 8 ++++++++ 3 files changed, 10 insertions(+) (limited to 'source3') diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c index 92aaebab1f..5bb76eb3bd 100644 --- a/source3/smbd/connection.c +++ b/source3/smbd/connection.c @@ -42,6 +42,7 @@ static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *p pkey->cnum = conn?conn->cnum:-1; fstrcpy(pkey->name, name); #ifdef DEVELOPER + /* valgrind fixer... */ { size_t sl = strlen(pkey->name); if (sizeof(fstring)-sl) diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 648801e955..2a2ca25532 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -184,6 +184,7 @@ static int negprot_spnego(char *p) safe_strcpy((char *)guid, global_myname(), sizeof(guid)-1); #ifdef DEVELOPER + /* valgrind fixer... */ { size_t sl = strlen(guid); if (sizeof(guid)-sl) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index f43a65af5c..161dc629dc 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -683,6 +683,14 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, mangle_map(mangled_name,True,True,SNUM(conn)); mangled_name[12] = 0; len = srvstr_push(outbuf, p+2, mangled_name, 24, STR_UPPER); +#ifdef DEVELOPER + /* valgrind fixer... */ + { + size_t sl = strlen(p+2); + if (24-sl) + memset(&p[sl+2], '\0', 24-sl); + } +#endif SSVAL(p, 0, len); } else { SSVAL(p,0,0); -- cgit