From 6885c6253e81fca9633c9396a5669fc7fe27ef7d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 20 May 2006 11:50:10 +0000 Subject: r15744: convert_string_talloc() handles src_len == 0 as error but it's valid in this case metze (This used to be commit 92c19b1ba4e89bd1e973e084b254087c98ceac18) --- source4/libcli/smb2/request.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/libcli') 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); -- cgit