[SCM] Samba Shared Repository - branch master updated - d68168e63386f900b70b82a7056f6e744cd5d50c

Jelmer Vernooij jelmer at samba.org
Sun Oct 12 02:03:36 GMT 2008


The branch, master has been updated
       via  d68168e63386f900b70b82a7056f6e744cd5d50c (commit)
      from  5237369ad8bac6a5fc80e32b313ce9f3266abc0f (commit)

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


- Log -----------------------------------------------------------------
commit d68168e63386f900b70b82a7056f6e744cd5d50c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 12 04:00:55 2008 +0200

    Cope with the fact that the data blobs returned are now
    talloc-allocated. Ideally, this memory should be talloc-stolen
    (and perhaps have DATA_BLOB in the interface everywhere), but
    that requires some more complex changes so I've just changed it to copy
    it for now.

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

Summary of changes:
 source3/smbd/seal.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c
index e9dc46a..18d8b64 100644
--- a/source3/smbd/seal.c
+++ b/source3/smbd/seal.c
@@ -426,9 +426,14 @@ static NTSTATUS srv_enc_spnego_gss_negotiate(unsigned char **ppdata, size_t *p_d
 	data_blob_free(&auth_reply);
 
 	SAFE_FREE(*ppdata);
-	*ppdata = response.data;
+	*ppdata = memdup(response.data, response.length);
+	if ((*ppdata) == NULL && response.length > 0) {
+		status = NT_STATUS_NO_MEMORY;
+	}
 	*p_data_size = response.length;
 
+	data_blob_free(&response);
+
 	return status;
 }
 #endif
@@ -463,8 +468,13 @@ static NTSTATUS srv_enc_ntlm_negotiate(unsigned char **ppdata, size_t *p_data_si
 	}
 
 	SAFE_FREE(*ppdata);
-	*ppdata = response.data;
+	*ppdata = memdup(response.data, response.length);
+	if ((*ppdata) == NULL && response.length > 0) {
+		status = NT_STATUS_NO_MEMORY;
+	}
 	*p_data_size = response.length;
+	data_blob_free(&response);
+
 	return status;
 }
 
@@ -585,8 +595,11 @@ static NTSTATUS srv_enc_spnego_ntlm_auth(connection_struct *conn,
 	}
 
 	SAFE_FREE(*ppdata);
-	*ppdata = response.data;
+	*ppdata = memdup(response.data, response.length);
+	if ((*ppdata) == NULL && response.length > 0)
+		return NT_STATUS_NO_MEMORY;
 	*p_data_size = response.length;
+	data_blob_free(&response);
 	return status;
 }
 
@@ -636,8 +649,11 @@ static NTSTATUS srv_enc_raw_ntlm_auth(connection_struct *conn,
 
 	/* Return the raw blob. */
 	SAFE_FREE(*ppdata);
-	*ppdata = response.data;
+	*ppdata = memdup(response.data, response.length);
+	if ((*ppdata) == NULL && response.length > 0)
+		return NT_STATUS_NO_MEMORY;
 	*p_data_size = response.length;
+	data_blob_free(&response);
 	return status;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list