diff options
-rw-r--r-- | source4/libcli/smb2/request.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c index bb8ff06e2d..a9a7e6b71f 100644 --- a/source4/libcli/smb2/request.c +++ b/source4/libcli/smb2/request.c @@ -252,6 +252,12 @@ NTSTATUS smb2_push_o16s16_blob(struct smb2_request_buffer *buf, uint8_t *ptr, DA return NT_STATUS_BUFFER_TOO_SMALL; } + if (blob.length == 0) { + SSVAL(ptr, 0, 0); + SSVAL(ptr, 4, 0); + return NT_STATUS_OK; + } + offset = buf->dynamic - buf->hdr; padding_length = smb2_padding_size(offset, 2); offset += padding_length; @@ -318,6 +324,12 @@ NTSTATUS smb2_push_o16s32_blob(struct smb2_request_buffer *buf, uint8_t *ptr, DA return NT_STATUS_BUFFER_TOO_SMALL; } + if (blob.length == 0) { + SSVAL(ptr, 0, 0); + SIVAL(ptr, 4, 0); + return NT_STATUS_OK; + } + offset = buf->dynamic - buf->hdr; padding_length = smb2_padding_size(offset, 2); offset += padding_length; @@ -382,6 +394,12 @@ NTSTATUS smb2_push_o32s32_blob(struct smb2_request_buffer *buf, uint8_t *ptr, DA return NT_STATUS_BUFFER_TOO_SMALL; } + if (blob.length == 0) { + SIVAL(ptr, 0, 0); + SIVAL(ptr, 4, 0); + return NT_STATUS_OK; + } + offset = buf->dynamic - buf->hdr; padding_length = smb2_padding_size(offset, 8); offset += padding_length; |