[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Wed Jun 20 04:55:02 MDT 2012


The branch, master has been updated
       via  db9180c idmap-hash: Attempt to fix Coverity ID 709116 Overflowed array index write
       via  963666a idmap-hash: Fix Coverity ID 709117 Dereference before null check
       via  cb614cd idmap-hash: Fix Coverity 709118 Dereference before null check
       via  0f65745 idmap-hash: Adapt mapfile_read_line to README.Coding
       via  7c0f125 idmap-hash: Fix Coverity ID 709119 Unused pointer value
      from  f0072d3 VERSION: Move on to beta3!

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit db9180c3d91253ee7dac1ed943f9a5a5b9e1a5a7
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jun 20 10:26:58 2012 +0200

    idmap-hash: Attempt to fix Coverity ID 709116 Overflowed array index write
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Wed Jun 20 12:53:59 CEST 2012 on sn-devel-104

commit 963666a3feb4a140d44fe70a23ab42420dc1c45b
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jun 20 08:43:36 2012 +0200

    idmap-hash: Fix Coverity ID 709117 Dereference before null check
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit cb614cd2d68ee6dc5c45a96b46cbf546f3869327
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jun 20 08:42:20 2012 +0200

    idmap-hash: Fix Coverity 709118 Dereference before null check
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 0f65745277d7ba73156593670a6d60b0883176fd
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jun 20 10:43:29 2012 +0200

    idmap-hash: Adapt mapfile_read_line to README.Coding
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 7c0f12573ff24fe44f917b2374611942bf531117
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jun 20 08:40:22 2012 +0200

    idmap-hash: Fix Coverity ID 709119 Unused pointer value
    
    "p" is overwritten further down again before it's first use
    
    Signed-off-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/winbindd/idmap_hash/idmap_hash.c |   20 ++++++++++----------
 source3/winbindd/idmap_hash/mapfile.c    |   10 ++++++++--
 2 files changed, 18 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c
index 1f36b21..cb518a8 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -166,6 +166,11 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
 	NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
 	int i;
 
+	if (!ids) {
+		nt_status = NT_STATUS_INVALID_PARAMETER;
+		BAIL_ON_NTSTATUS_ERROR(nt_status);
+	}
+
 	/* initialize the status to avoid suprise */
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
@@ -174,11 +179,6 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
 	nt_status = be_init(dom);
 	BAIL_ON_NTSTATUS_ERROR(nt_status);
 
-	if (!ids) {
-		nt_status = NT_STATUS_INVALID_PARAMETER;
-		BAIL_ON_NTSTATUS_ERROR(nt_status);
-	}
-
 	for (i=0; ids[i]; i++) {
 		uint32_t h_domain, h_rid;
 
@@ -216,6 +216,11 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
 	NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
 	int i;
 
+	if (!ids) {
+		nt_status = NT_STATUS_INVALID_PARAMETER;
+		BAIL_ON_NTSTATUS_ERROR(nt_status);
+	}
+
 	/* initialize the status to avoid suprise */
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
@@ -224,11 +229,6 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
 	nt_status = be_init(dom);
 	BAIL_ON_NTSTATUS_ERROR(nt_status);
 
-	if (!ids) {
-		nt_status = NT_STATUS_INVALID_PARAMETER;
-		BAIL_ON_NTSTATUS_ERROR(nt_status);
-	}
-
 	for (i=0; ids[i]; i++) {
 		struct dom_sid sid;
 		uint32_t rid;
diff --git a/source3/winbindd/idmap_hash/mapfile.c b/source3/winbindd/idmap_hash/mapfile.c
index 075f0f2..a0e2b48 100644
--- a/source3/winbindd/idmap_hash/mapfile.c
+++ b/source3/winbindd/idmap_hash/mapfile.c
@@ -67,13 +67,19 @@ static bool mapfile_read_line(fstring key, fstring value)
 	if (!lw_map_file)
 		return false;
 
-	if ((p = x_fgets(buffer, sizeof(buffer)-1, lw_map_file)) == NULL) {
+	p = x_fgets(buffer, sizeof(buffer)-1, lw_map_file);
+	if (p == NULL) {
 		return false;
 	}
 
 	/* Strip newlines and carriage returns */
 
-	len = strlen_m(buffer) - 1;
+	len = strlen_m(buffer);
+	if (len == 0) {
+		return false;
+	}
+	len -= 1;
+
 	while ((buffer[len] == '\n') || (buffer[len] == '\r')) {
 		buffer[len--] = '\0';
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list