The branch, master has been updated via ce8068e remove many valgrind errors for base.lock test via 7ade519 fix uninitialised read in process_host_announce via 17482d5 fix writev(vector[...]) points to uninitialised bytes in call_trans2findnext via 0f2f8a4 fix 'Invalid read of size 1' in reply_search via 9b2aba1 fix writev(vector[...]) points to uninitialised bytes in call_trans2findfirst from 8a40da8 ldb: version 1.1.23
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit ce8068e70b11a3ce5634c56f43a035713c5ea2ed Author: Noel Power <noel.po...@suse.com> Date: Thu Oct 29 11:11:00 2015 +0000 remove many valgrind errors for base.lock test mostly "Conditional jump or move depends on uninitialised value" & "Use of uninitialised value of size 8" errors, suspect this is related to compiler padding for the struct Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Fri Nov 6 00:16:53 CET 2015 on sn-devel-104 commit 7ade51901381507beaeac92e9b0d2f0d424123a9 Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 28 21:17:42 2015 +0000 fix uninitialised read in process_host_announce Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> commit 17482d52160acc869af9f7a2029d5b595d33a12d Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 28 19:53:49 2015 +0000 fix writev(vector[...]) points to uninitialised bytes in call_trans2findnext Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> commit 0f2f8a4f772ff22d00a9e87dafa97a431af8f6da Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 28 17:08:28 2015 +0000 fix 'Invalid read of size 1' in reply_search Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> commit 9b2aba1b7aa7386dfc64bcefafa83374b6525354 Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 28 15:42:06 2015 +0000 fix writev(vector[...]) points to uninitialised bytes in call_trans2findfirst Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/locking/brlock.c | 2 ++ source3/nmbd/nmbd_incomingdgrams.c | 2 ++ source3/smbd/reply.c | 9 +++++---- source3/smbd/trans2.c | 11 ++++++++++- 4 files changed, 19 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index 05e7ee2..e8c8d89 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -1021,6 +1021,8 @@ NTSTATUS brl_lock(struct messaging_context *msg_ctx, NTSTATUS ret; struct lock_struct lock; + ZERO_STRUCT(lock); + #if !ZERO_ZERO if (start == 0 && size == 0) { DEBUG(0,("client sent 0/0 lock - please report this\n")); diff --git a/source3/nmbd/nmbd_incomingdgrams.c b/source3/nmbd/nmbd_incomingdgrams.c index 9a69252..6fedcfd 100644 --- a/source3/nmbd/nmbd_incomingdgrams.c +++ b/source3/nmbd/nmbd_incomingdgrams.c @@ -105,6 +105,8 @@ void process_host_announce(struct subnet_record *subrec, struct packet_struct *p struct server_record *servrec; unstring work_name; unstring source_name; + ZERO_STRUCT(source_name); + ZERO_STRUCT(announce_name); pull_ascii_fstring(comment, buf+31); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index c796c00..c437135 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1607,7 +1607,7 @@ void reply_search(struct smb_request *req) { connection_struct *conn = req->conn; char *path = NULL; - const char *mask = NULL; + char *mask = NULL; char *directory = NULL; struct smb_filename *smb_fname = NULL; char *fname = NULL; @@ -1688,11 +1688,11 @@ void reply_search(struct smb_request *req) p = strrchr_m(directory,'/'); if ((p != NULL) && (*directory != '/')) { - mask = p + 1; + mask = talloc_strdup(ctx, p + 1); directory = talloc_strndup(ctx, directory, PTR_DIFF(p, directory)); } else { - mask = directory; + mask = talloc_strdup(ctx, directory); directory = talloc_strdup(ctx,"."); } @@ -1741,7 +1741,7 @@ void reply_search(struct smb_request *req) goto out; } - mask = dptr_wcard(sconn, dptr_num); + mask = talloc_strdup(ctx, dptr_wcard(sconn, dptr_num)); if (!mask) { goto SearchEmpty; } @@ -1880,6 +1880,7 @@ void reply_search(struct smb_request *req) maxentries )); out: TALLOC_FREE(directory); + TALLOC_FREE(mask); TALLOC_FREE(smb_fname); END_PROFILE(SMBsearch); return; diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 58d18fb..e2e4c80 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2639,7 +2639,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, 10); if (*pparams == NULL) { @@ -2986,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 ) { -- Samba Shared Repository