summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-18 17:58:47 +0000
committerJeremy Allison <jra@samba.org>2004-03-18 17:58:47 +0000
commit351eb266176f6a4c204e92c206ce3791237b195a (patch)
tree8d5446119d3f7ab6afd45c3a53f006a68997e28f
parenta650789626f7a546367bf950385bfb3ddb2911ff (diff)
downloadsamba-351eb266176f6a4c204e92c206ce3791237b195a.tar.gz
samba-351eb266176f6a4c204e92c206ce3791237b195a.tar.bz2
samba-351eb266176f6a4c204e92c206ce3791237b195a.zip
Correctness patch from fumiya@miraclelinux.com to count characters correctly,
doesn't affect what got put on the wire. Jeremy. (This used to be commit 05243a8de06b6589e2405a4a7be25cdf5d338c10)
-rw-r--r--source3/lib/charcnv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index f6028bb134..11b1448f1e 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -839,6 +839,9 @@ size_t push_ascii_nstring(void *dest, const char *src)
smb_panic("failed to create UCS2 buffer");
}
+ /* We're using buffer_len below to count ucs2 characters, not bytes. */
+ buffer_len /= sizeof(smb_ucs2_t);
+
dest_len = 0;
for (i = 0; buffer[i] != 0 && (i < buffer_len); i++) {
unsigned char mb[10];