summaryrefslogtreecommitdiff
path: root/source4/libcli/smb2
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-07-08 08:34:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:55 -0500
commit7c810db7da89c992a7886757b7aec68eef0cf3eb (patch)
tree97b79dcb0bafe3da7716810eae9555400db899e8 /source4/libcli/smb2
parente8b61d7cc830b4f9f23618757fca1d8b8f095873 (diff)
downloadsamba-7c810db7da89c992a7886757b7aec68eef0cf3eb.tar.gz
samba-7c810db7da89c992a7886757b7aec68eef0cf3eb.tar.bz2
samba-7c810db7da89c992a7886757b7aec68eef0cf3eb.zip
r16873: - 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 (This used to be commit 3cf50e26b7dc11d85c46ef81a36c74acf97085c0)
Diffstat (limited to 'source4/libcli/smb2')
-rw-r--r--source4/libcli/smb2/request.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index 016c885675..c37325fc34 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -301,7 +301,7 @@ NTSTATUS smb2_push_o16s16_blob(struct smb2_request_buffer *buf,
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 @@ NTSTATUS smb2_push_o16s16_blob(struct smb2_request_buffer *buf,
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 @@ NTSTATUS smb2_push_o16s32_blob(struct smb2_request_buffer *buf,
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 @@ NTSTATUS smb2_push_o16s32_blob(struct smb2_request_buffer *buf,
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 @@ NTSTATUS smb2_push_o32s32_blob(struct smb2_request_buffer *buf,
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 @@ NTSTATUS smb2_push_o32s32_blob(struct smb2_request_buffer *buf,
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 @@ NTSTATUS smb2_push_s32o32_blob(struct smb2_request_buffer *buf,
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 @@ NTSTATUS smb2_push_s32o32_blob(struct smb2_request_buffer *buf,
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;
}