[SCM] Samba Shared Repository - branch v4-4-test updated

Karolin Seeger kseeger at samba.org
Fri Jul 8 11:00:03 UTC 2016


The branch, v4-4-test has been updated
       via  b5aa461 auth: fix a memory leak in gssapi_get_session_key()
       via  ebc1e9a s3-libads: fix a memory leak in ads_sasl_spnego_bind()
      from  e93603f VERSION: Bump version up to 4.4.6...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-4-test


- Log -----------------------------------------------------------------
commit b5aa461a0067881b8b0284c2af1f73fd9163f53a
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Jul 3 22:50:22 2016 +0300

    auth: fix a memory leak in gssapi_get_session_key()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12006
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Richard Sharpe <rsharpe at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Richard Sharpe <sharpe at samba.org>
    Autobuild-Date(master): Wed Jul  6 00:40:15 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 77f3730295735dc9465c8e3d07fc761c83761b6e)
    
    Autobuild-User(v4-4-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-4-test): Fri Jul  8 12:59:29 CEST 2016 on sn-devel-144

commit ebc1e9aba42bb62681f5abe4c56ba29070d2e2cc
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Jul 3 22:51:56 2016 +0300

    s3-libads: fix a memory leak in ads_sasl_spnego_bind()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12006
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Richard Sharpe <rsharpe at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit a646d9e796902dcb5246eb585433d4859796be2f)

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

Summary of changes:
 auth/kerberos/gssapi_pac.c | 7 +------
 source3/libads/sasl.c      | 5 ++++-
 2 files changed, 5 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/kerberos/gssapi_pac.c b/auth/kerberos/gssapi_pac.c
index 685d0ec..74c199a 100644
--- a/auth/kerberos/gssapi_pac.c
+++ b/auth/kerberos/gssapi_pac.c
@@ -246,6 +246,7 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
 		int diflen, i;
 		const uint8_t *p;
 
+		*keytype = 0;
 		if (set->count < 2) {
 
 #ifdef HAVE_GSSKRB5_GET_SUBKEY
@@ -256,10 +257,6 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
 			if (gss_maj == 0) {
 				*keytype = KRB5_KEY_TYPE(subkey);
 				krb5_free_keyblock(NULL /* should be krb5_context */, subkey);
-			} else
-#else
-			{
-				*keytype = 0;
 			}
 #endif
 			gss_maj = gss_release_buffer_set(&gss_min, &set);
@@ -270,7 +267,6 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
 				  gse_sesskeytype_oid.elements,
 				  gse_sesskeytype_oid.length) != 0) {
 			/* Perhaps a non-krb5 session key */
-			*keytype = 0;
 			gss_maj = gss_release_buffer_set(&gss_min, &set);
 			return NT_STATUS_OK;
 		}
@@ -280,7 +276,6 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
 			gss_maj = gss_release_buffer_set(&gss_min, &set);
 			return NT_STATUS_INVALID_PARAMETER;
 		}
-		*keytype = 0;
 		for (i = 0; i < diflen; i++) {
 			*keytype = (*keytype << 7) | (p[i] & 0x7f);
 			if (i + 1 != diflen && (p[i] & 0x80) == 0) {
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c
index 10f63e8..d76d872 100644
--- a/source3/libads/sasl.c
+++ b/source3/libads/sasl.c
@@ -696,7 +696,7 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads)
 	struct berval *scred=NULL;
 	int rc, i;
 	ADS_STATUS status;
-	DATA_BLOB blob;
+	DATA_BLOB blob = data_blob_null;
 	char *given_principal = NULL;
 	char *OIDs[ASN1_MAX_OIDS];
 #ifdef HAVE_KRB5
@@ -792,6 +792,9 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads)
 done:
 	ads_free_service_principal(&p);
 	TALLOC_FREE(frame);
+	if (blob.data != NULL) {
+		data_blob_free(&blob);
+	}
 	return status;
 }
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list