[PATCH] fix a crash

Michael Adam obnox at samba.org
Tue Mar 1 19:44:58 UTC 2016


Crash due to uninitialized memory access.

Sorry Günther, since you did not send
it out yet, here is it re-done and
authored by me. ;-) :-P

Review/push appreciated!

Cheers - Michael
-------------- next part --------------
From 8f052b40be1f7f19ab6e8cd72fd81cfd52c7a312 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 1 Mar 2016 20:40:47 +0100
Subject: [PATCH] smbd: fix crash in smbXsrv_client_global_remove()

Probably copy-n-paste error.
Uncovered by the multi-channel-related tests we're
currently writing to exercise this code more.

Pair-Programmed-With: Guenther Deschner <gd at samba.org>

Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source3/smbd/smbXsrv_client.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/source3/smbd/smbXsrv_client.c b/source3/smbd/smbXsrv_client.c
index 934460c..7286b6e 100644
--- a/source3/smbd/smbXsrv_client.c
+++ b/source3/smbd/smbXsrv_client.c
@@ -428,7 +428,6 @@ static NTSTATUS smbXsrv_client_global_store(struct smbXsrv_client_global0 *globa
 
 static NTSTATUS smbXsrv_client_global_remove(struct smbXsrv_client_global0 *global)
 {
-	struct smbXsrv_client_globalB global_blob;
 	TDB_DATA key;
 	NTSTATUS status;
 
@@ -453,11 +452,8 @@ static NTSTATUS smbXsrv_client_global_remove(struct smbXsrv_client_global0 *glob
 		return status;
 	}
 	global->stored = false;
-	if (DEBUGLVL(DBGLVL_DEBUG)) {
-		DBG_DEBUG("key '%s' delete\n",
-			hex_encode_talloc(global->db_rec, key.dptr, key.dsize));
-		NDR_PRINT_DEBUG(smbXsrv_client_globalB, &global_blob);
-	}
+	DBG_DEBUG("key '%s' delete\n",
+		  hex_encode_talloc(global->db_rec, key.dptr, key.dsize));
 
 	TALLOC_FREE(global->db_rec);
 
-- 
2.5.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160301/02c1575e/signature.sig>


More information about the samba-technical mailing list