svn commit: samba r16873 - in branches/SAMBA_4_0/source/libcli/smb2: .

metze at samba.org metze at samba.org
Sat Jul 8 08:34:36 GMT 2006


Author: metze
Date: 2006-07-08 08:34:35 +0000 (Sat, 08 Jul 2006)
New Revision: 16873

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

Log:
- grow the buffer with the correct size, we maybe had 1 byte preallocated
- body_size doesn't contain the preallocated byte so don't remove it

metze
Modified:
   branches/SAMBA_4_0/source/libcli/smb2/request.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/smb2/request.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/smb2/request.c	2006-07-08 08:20:10 UTC (rev 16872)
+++ branches/SAMBA_4_0/source/libcli/smb2/request.c	2006-07-08 08:34:35 UTC (rev 16873)
@@ -301,7 +301,7 @@
 	SSVAL(ptr, 0, offset);
 	SSVAL(ptr, 2, blob.length);
 
-	status = smb2_grow_buffer(buf, padding_length + blob.length);
+	status = smb2_grow_buffer(buf, blob.length + padding_length - padding_fix);
 	NT_STATUS_NOT_OK_RETURN(status);
 
 	memset(buf->dynamic, 0, padding_length);
@@ -311,7 +311,7 @@
 	buf->dynamic += blob.length;
 
 	buf->size += blob.length + padding_length - padding_fix;
-	buf->body_size += blob.length + padding_length - padding_fix;
+	buf->body_size += blob.length + padding_length;
 
 	return NT_STATUS_OK;
 }
@@ -354,7 +354,7 @@
 	SSVAL(ptr, 0, offset);
 	SIVAL(ptr, 2, blob.length);
 
-	status = smb2_grow_buffer(buf, padding_length + blob.length);
+	status = smb2_grow_buffer(buf, blob.length + padding_length - padding_fix);
 	NT_STATUS_NOT_OK_RETURN(status);
 
 	memset(buf->dynamic, 0, padding_length);
@@ -364,7 +364,7 @@
 	buf->dynamic += blob.length;
 
 	buf->size += blob.length + padding_length - padding_fix;
-	buf->body_size += blob.length + padding_length - padding_fix;
+	buf->body_size += blob.length + padding_length;
 
 	return NT_STATUS_OK;
 }
@@ -407,7 +407,7 @@
 	SIVAL(ptr, 0, offset);
 	SIVAL(ptr, 4, blob.length);
 
-	status = smb2_grow_buffer(buf, padding_length + blob.length);
+	status = smb2_grow_buffer(buf, blob.length + padding_length - padding_fix);
 	NT_STATUS_NOT_OK_RETURN(status);
 
 	memset(buf->dynamic, 0, padding_length);
@@ -417,7 +417,7 @@
 	buf->dynamic += blob.length;
 
 	buf->size += blob.length + padding_length - padding_fix;
-	buf->body_size += blob.length + padding_length - padding_fix;
+	buf->body_size += blob.length + padding_length;
 
 	return NT_STATUS_OK;
 }
@@ -460,7 +460,7 @@
 	SIVAL(ptr, 0, blob.length);
 	SIVAL(ptr, 4, offset);
 
-	status = smb2_grow_buffer(buf, padding_length + blob.length);
+	status = smb2_grow_buffer(buf, blob.length + padding_length - padding_fix);
 	NT_STATUS_NOT_OK_RETURN(status);
 
 	memset(buf->dynamic, 0, padding_length);
@@ -470,7 +470,7 @@
 	buf->dynamic += blob.length;
 
 	buf->size += blob.length + padding_length - padding_fix;
-	buf->body_size += blob.length + padding_length - padding_fix;
+	buf->body_size += blob.length + padding_length;
 
 	return NT_STATUS_OK;
 }



More information about the samba-cvs mailing list