From 0c5214e2eb6249914230f092fe35dfa49da24c34 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 29 Mar 2011 11:16:26 -0700 Subject: Ensure convert_string_XXX is always called with a valid converted_size pointer. Preparation for cleaning up this API. Autobuild-User: Jeremy Allison Autobuild-Date: Tue Mar 29 21:01:49 CEST 2011 on sn-devel-104 --- source4/smb_server/smb/request.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/smb_server/smb') diff --git a/source4/smb_server/smb/request.c b/source4/smb_server/smb/request.c index 59a34a0b13..d478963c90 100644 --- a/source4/smb_server/smb/request.c +++ b/source4/smb_server/smb/request.c @@ -483,6 +483,7 @@ static size_t req_pull_ucs2(struct request_bufinfo *bufinfo, const char **dest, int src_len, src_len2, alignment=0; bool ret; char *dest2; + size_t converted_size = 0; if (!(flags & STR_NOALIGN) && ucs2_align(bufinfo->align_base, src, flags)) { src++; @@ -512,7 +513,7 @@ static size_t req_pull_ucs2(struct request_bufinfo *bufinfo, const char **dest, return src_len2 + alignment; } - ret = convert_string_talloc(bufinfo->mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2, NULL); + ret = convert_string_talloc(bufinfo->mem_ctx, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2, &converted_size); if (!ret) { *dest = NULL; @@ -541,6 +542,7 @@ static size_t req_pull_ascii(struct request_bufinfo *bufinfo, const char **dest, int src_len, src_len2; bool ret; char *dest2; + size_t converted_size = 0; if (flags & STR_NO_RANGE_CHECK) { src_len = byte_len; @@ -561,7 +563,7 @@ static size_t req_pull_ascii(struct request_bufinfo *bufinfo, const char **dest, src_len2++; } - ret = convert_string_talloc(bufinfo->mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2, NULL); + ret = convert_string_talloc(bufinfo->mem_ctx, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2, &converted_size); if (!ret) { *dest = NULL; -- cgit