diff options
author | Jeremy Allison <jra@samba.org> | 2011-03-29 11:16:26 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-03-29 21:01:49 +0200 |
commit | 0c5214e2eb6249914230f092fe35dfa49da24c34 (patch) | |
tree | a7e0b1952b1993e1859a6653fc38caf2501e6858 /source4/smb_server/smb | |
parent | 1e50f9a5c263ed19ef8e9c689c96f1e51194f405 (diff) | |
download | samba-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/smb_server/smb')
-rw-r--r-- | source4/smb_server/smb/request.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |