summaryrefslogtreecommitdiff
path: root/source3/libgpo/gpo_ini.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-21 18:04:47 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-21 18:04:47 +0200
commit20796bcf57a7f5e1921dc12e0568221f985fe4f2 (patch)
tree8f0540a602a9ea0031d656bc31c0b8bc1e91eb70 /source3/libgpo/gpo_ini.c
parent323be4a6907e4915bb76aa103bf5b868f0b459b1 (diff)
parent1a416ff13ca7786f2e8d24c66addf00883e9cb12 (diff)
downloadsamba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.tar.gz
samba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.tar.bz2
samba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.zip
Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into docbook
Conflicts: source/Makefile.in (This used to be commit 01987778a123f853fccdcb7fe9566143e2d7c490)
Diffstat (limited to 'source3/libgpo/gpo_ini.c')
-rw-r--r--source3/libgpo/gpo_ini.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/libgpo/gpo_ini.c b/source3/libgpo/gpo_ini.c
index 6f1593c2c2..54aaffa477 100644
--- a/source3/libgpo/gpo_ini.c
+++ b/source3/libgpo/gpo_ini.c
@@ -57,6 +57,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
char *tmp_name = NULL;
NTSTATUS status;
size_t n = 0;
+ size_t converted_size;
if (!filename_out) {
return NT_STATUS_INVALID_PARAMETER;
@@ -81,10 +82,9 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
goto out;
}
- n = convert_string_talloc(mem_ctx, CH_UTF16LE, CH_UNIX,
- data_in, n, &data_out, False);
-
- if (n == -1) {
+ if (!convert_string_talloc(mem_ctx, CH_UTF16LE, CH_UNIX, data_in, n,
+ &data_out, &converted_size, False))
+ {
status = NT_STATUS_INVALID_BUFFER_SIZE;
goto out;
}
@@ -99,10 +99,10 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
DEBUG(11,("convert_file_from_ucs2: "
"%s skipping utf8 BOM\n", tmp_name));
data_out += 3;
- n -= 3;
+ converted_size -= 3;
}
- if (sys_write(tmp_fd, data_out, n) != n) {
+ if (sys_write(tmp_fd, data_out, converted_size) != converted_size) {
status = map_nt_error_from_unix(errno);
goto out;
}