summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-03-29 11:16:26 -0700
committerJeremy Allison <jra@samba.org>2011-03-29 21:01:49 +0200
commit0c5214e2eb6249914230f092fe35dfa49da24c34 (patch)
treea7e0b1952b1993e1859a6653fc38caf2501e6858 /source4/libcli
parent1e50f9a5c263ed19ef8e9c689c96f1e51194f405 (diff)
downloadsamba-0c5214e2eb6249914230f092fe35dfa49da24c34.tar.gz
samba-0c5214e2eb6249914230f092fe35dfa49da24c34.tar.bz2
samba-0c5214e2eb6249914230f092fe35dfa49da24c34.zip
Ensure convert_string_XXX is always called with a valid converted_size pointer.
Preparation for cleaning up this API. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Mar 29 21:01:49 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/raw/rawfileinfo.c4
-rw-r--r--source4/libcli/smb2/request.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c
index 5efa4dd337..50a6731ba4 100644
--- a/source4/libcli/raw/rawfileinfo.c
+++ b/source4/libcli/raw/rawfileinfo.c
@@ -51,6 +51,8 @@ NTSTATUS smbcli_parse_stream_info(DATA_BLOB blob, TALLOC_CTX *mem_ctx,
uint32_t nlen, len;
bool ret;
void *vstr;
+ size_t converted_size = 0;
+
io->streams =
talloc_realloc(mem_ctx, io->streams, struct stream_struct, n+1);
if (!io->streams) {
@@ -64,7 +66,7 @@ NTSTATUS smbcli_parse_stream_info(DATA_BLOB blob, TALLOC_CTX *mem_ctx,
}
ret = convert_string_talloc(io->streams,
CH_UTF16, CH_UNIX,
- blob.data+ofs+24, nlen, &vstr, NULL);
+ blob.data+ofs+24, nlen, &vstr, &converted_size);
if (!ret) {
return NT_STATUS_ILLEGAL_CHARACTER;
}
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index bf96d05bea..729b003aed 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -686,6 +686,7 @@ NTSTATUS smb2_pull_o16s16_string(struct smb2_request_buffer *buf, TALLOC_CTX *me
DATA_BLOB blob;
NTSTATUS status;
void *vstr;
+ size_t converted_size = 0;
bool ret;
status = smb2_pull_o16s16_blob(buf, mem_ctx, ptr, &blob);
@@ -705,7 +706,7 @@ NTSTATUS smb2_pull_o16s16_string(struct smb2_request_buffer *buf, TALLOC_CTX *me
}
ret = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
- blob.data, blob.length, &vstr, NULL);
+ blob.data, blob.length, &vstr, &converted_size);
data_blob_free(&blob);
(*str) = (char *)vstr;
if (!ret) {