summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-20 11:50:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:12 -0500
commit6885c6253e81fca9633c9396a5669fc7fe27ef7d (patch)
tree08110ccdb454b880e21ef921ed7e2fecded20363
parent44dc58fe168dc4315d7dadf1029de821f2bb0c09 (diff)
downloadsamba-6885c6253e81fca9633c9396a5669fc7fe27ef7d.tar.gz
samba-6885c6253e81fca9633c9396a5669fc7fe27ef7d.tar.bz2
samba-6885c6253e81fca9633c9396a5669fc7fe27ef7d.zip
r15744: convert_string_talloc() handles src_len == 0 as error
but it's valid in this case metze (This used to be commit 92c19b1ba4e89bd1e973e084b254087c98ceac18)
-rw-r--r--source4/libcli/smb2/request.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index 136b81e977..e631375a52 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -522,6 +522,14 @@ NTSTATUS smb2_pull_o16s16_string(struct smb2_request_buffer *buf, TALLOC_CTX *me
status = smb2_pull_o16s16_blob(buf, mem_ctx, ptr, &blob);
NT_STATUS_NOT_OK_RETURN(status);
+ if (blob.length == 0) {
+ char *s;
+ s = talloc_strdup(mem_ctx, "");
+ NT_STATUS_HAVE_NO_MEMORY(s);
+ *str = s;
+ return NT_STATUS_OK;
+ }
+
size = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
blob.data, blob.length, &vstr);
data_blob_free(&blob);