svn commit: samba r8154 - in branches/SAMBA_4_0/source/torture/auth: .

metze at samba.org metze at samba.org
Mon Jul 4 17:04:36 GMT 2005


Author: metze
Date: 2005-07-04 17:04:36 +0000 (Mon, 04 Jul 2005)
New Revision: 8154

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8154

Log:
- fix some mem_leals

- check if the buffer length of the original and created buffer are equal

metze

Modified:
   branches/SAMBA_4_0/source/torture/auth/pac.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/auth/pac.c
===================================================================
--- branches/SAMBA_4_0/source/torture/auth/pac.c	2005-07-04 16:53:28 UTC (rev 8153)
+++ branches/SAMBA_4_0/source/torture/auth/pac.c	2005-07-04 17:04:36 UTC (rev 8154)
@@ -251,6 +251,7 @@
 					 (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA);
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		DEBUG(0,("can't parse the PAC\n"));
+		talloc_free(mem_ctx);
 		return False;
 	}
 
@@ -258,11 +259,24 @@
 					 (ndr_push_flags_fn_t)ndr_push_PAC_DATA);
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		DEBUG(0, ("PAC push failed: %s\n", nt_errstr(nt_status)));
+		talloc_free(mem_ctx);
 		return False;
 	}
 
 	/* dump_data(0,validate_blob.data,validate_blob.length); */
 
+	/* all we can check is the length of the buffers,
+	 * to check that the alignment and padding is ok,
+	 * we can't compare the bytes, because we use a different algorithm
+	 * to create the pointer values
+	 */
+	if (tmp_blob.length != validate_blob.length) {
+		DEBUG(0, ("PAC push failed orignial buffer length[%u] != created buffer length[%u]\n",
+				tmp_blob.length, validate_blob.length));
+		talloc_free(mem_ctx);
+		return False;
+	}
+
 	talloc_free(mem_ctx);
 	return True;
 }



More information about the samba-cvs mailing list