summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2015-10-28 19:53:49 +0000
committerJeremy Allison <jra@samba.org>2015-11-05 21:12:10 +0100
commit17482d52160acc869af9f7a2029d5b595d33a12d (patch)
treebb7123f8009db7d185843766fb30997299931f78
parent0f2f8a4f772ff22d00a9e87dafa97a431af8f6da (diff)
downloadsamba-17482d52160acc869af9f7a2029d5b595d33a12d.tar.gz
fix writev(vector[...]) points to uninitialised bytes in call_trans2findnext
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r--source3/smbd/trans2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 967a56c1145..e2e4c8047ae 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2990,6 +2990,11 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
pdata = *ppdata;
data_end = pdata + max_data_bytes + DIR_ENTRY_SAFETY_MARGIN - 1;
+ /*
+ * squash valgrind "writev(vector[...]) points to uninitialised byte(s)"
+ * error.
+ */
+ memset(pdata + total_data, 0, (max_data_bytes + DIR_ENTRY_SAFETY_MARGIN) - total_data);
/* Realloc the params space */
*pparams = (char *)SMB_REALLOC(*pparams, 6*SIZEOFWORD);
if(*pparams == NULL ) {