diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-11-16 15:47:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:46:20 -0500 |
commit | fb90bebab64c8eb02dc190d829b44eb592230302 (patch) | |
tree | 254e3f59c531659299b7d2fee7dd14f7f26360c8 /source4/libcli | |
parent | ed069c1771843e0de0489bad7e0959c34fd260c8 (diff) | |
download | samba-fb90bebab64c8eb02dc190d829b44eb592230302.tar.gz samba-fb90bebab64c8eb02dc190d829b44eb592230302.tar.bz2 samba-fb90bebab64c8eb02dc190d829b44eb592230302.zip |
r11743: - push the length at the correct offset
- let us push empty strings
metze
(This used to be commit 17c4b6298d757f2e53fe764608504bf737005cbe)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/smb2/request.c | 11 |
1 files changed, 9 insertions, 2 deletions
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) { |