svn commit: samba r4383 - in branches/SAMBA_4_0/source/smb_server: .

tridge at samba.org tridge at samba.org
Tue Dec 28 23:28:02 GMT 2004


Author: tridge
Date: 2004-12-28 23:28:02 +0000 (Tue, 28 Dec 2004)
New Revision: 4383

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

Log:
in order to cope with overfilled buffers on trans2 findfirst we need to use 32 bit offsets and lengths
in trans2 fill code, even though the packets themselves can only use 16 bit lengths. This prevents
the overflow detection code from failing due to 16 bit length wrap.


Modified:
   branches/SAMBA_4_0/source/smb_server/trans2.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/trans2.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/trans2.c	2004-12-28 23:26:29 UTC (rev 4382)
+++ branches/SAMBA_4_0/source/smb_server/trans2.c	2004-12-28 23:28:02 UTC (rev 4383)
@@ -119,8 +119,8 @@
 */
 static size_t trans2_push_data_string(struct smbsrv_request *req, 
 				      struct smb_trans2 *trans,
-				      uint16_t len_offset,
-				      uint16_t offset,
+				      uint32_t len_offset,
+				      uint32_t offset,
 				      const WIRE_STRING *str,
 				      int dest_len,
 				      int flags)
@@ -193,7 +193,7 @@
 					int flags)
 {
 	size_t ret;
-	uint16_t offset;
+	uint32_t offset;
 	const int max_bytes_per_char = 3;
 
 	offset = trans->out.data.length;
@@ -718,7 +718,7 @@
 		SSVAL(trans->out.params.data, 0, 0);
 
 		for (i=0;i<st->stream_info.out.num_streams;i++) {
-			uint16_t data_size = trans->out.data.length;
+			uint32_t data_size = trans->out.data.length;
 			uint8_t *data;
 
 			trans2_grow_data(req, trans, data_size + 24);
@@ -1277,7 +1277,8 @@
 		}
 	}
 
-	/* setup the private state structure that the backend will give us in the callback */
+	/* setup the private state structure that the backend will
+	   give us in the callback */
 	state.req = req;
 	state.trans = trans;
 	state.level = search.t2ffirst.level;



More information about the samba-cvs mailing list