From fb90bebab64c8eb02dc190d829b44eb592230302 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 16 Nov 2005 15:47:44 +0000 Subject: r11743: - push the length at the correct offset - let us push empty strings metze (This used to be commit 17c4b6298d757f2e53fe764608504bf737005cbe) --- source4/libcli/smb2/request.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c index a9a7e6b71f..bc278897a5 100644 --- a/source4/libcli/smb2/request.c +++ b/source4/libcli/smb2/request.c @@ -254,7 +254,7 @@ NTSTATUS smb2_push_o16s16_blob(struct smb2_request_buffer *buf, uint8_t *ptr, DA if (blob.length == 0) { SSVAL(ptr, 0, 0); - SSVAL(ptr, 4, 0); + SSVAL(ptr, 2, 0); return NT_STATUS_OK; } @@ -326,7 +326,7 @@ NTSTATUS smb2_push_o16s32_blob(struct smb2_request_buffer *buf, uint8_t *ptr, DA if (blob.length == 0) { SSVAL(ptr, 0, 0); - SIVAL(ptr, 4, 0); + SIVAL(ptr, 2, 0); return NT_STATUS_OK; } @@ -457,6 +457,13 @@ NTSTATUS smb2_push_o16s16_string(struct smb2_request_buffer *buf, NTSTATUS status; ssize_t size; + if (strcmp("", str) == 0) { + blob = data_blob(NULL, 0); + status = smb2_push_o16s16_blob(buf, ptr, blob); + NT_STATUS_NOT_OK_RETURN(status); + return NT_STATUS_OK; + } + size = convert_string_talloc(buf->buffer, CH_UNIX, CH_UTF16, str, strlen(str), (void **)&blob.data); if (size == -1) { -- cgit