summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-02-18 14:53:48 +1100
committerAndrew Tridgell <tridge@samba.org>2008-02-18 14:53:48 +1100
commit26b8701321909e10aac124324695f9f4891b1f8d (patch)
tree6e400da9b8fcc415bfaa8f56c2e01a34adf41cc6 /source4/libcli
parentafe8e5551e41550f40271f49ab4ded5e5f0def9c (diff)
downloadsamba-26b8701321909e10aac124324695f9f4891b1f8d.tar.gz
samba-26b8701321909e10aac124324695f9f4891b1f8d.tar.bz2
samba-26b8701321909e10aac124324695f9f4891b1f8d.zip
handle pushing of zero length smb2 strings
(This used to be commit 66d0502228b31533b5d93731128a681992c22eda)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/smb2/request.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index 1de0531d9a..2471fcaa4d 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -668,6 +668,12 @@ NTSTATUS smb2_push_o16s16_string(struct smb2_request_buffer *buf,
return smb2_push_o16s16_blob(buf, ofs, data_blob(NULL, 0));
}
+ if (*str == 0) {
+ blob.data = str;
+ blob.length = 0;
+ return smb2_push_o16s16_blob(buf, ofs, blob);
+ }
+
size = convert_string_talloc(buf->buffer, lp_iconv_convenience(global_loadparm), CH_UNIX, CH_UTF16,
str, strlen(str), (void **)&blob.data);
if (size == -1) {