diff options
author | Jeremy Allison <jra@samba.org> | 2004-03-18 17:58:50 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-03-18 17:58:50 +0000 |
commit | c66f52a5ac89c6b5c2d51653d2c012a9171cb56b (patch) | |
tree | 5584c37f31a5654856612026b383de6020ff09a2 /source3 | |
parent | 6069395ed156d30d277f342e497f98189c3caf2e (diff) | |
download | samba-c66f52a5ac89c6b5c2d51653d2c012a9171cb56b.tar.gz samba-c66f52a5ac89c6b5c2d51653d2c012a9171cb56b.tar.bz2 samba-c66f52a5ac89c6b5c2d51653d2c012a9171cb56b.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 e8b68ef965ea2e3bed41cb397ef32df05c631e92)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/charcnv.c | 3 |
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]; |