summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-07-18 23:01:44 +0000
committerJeremy Allison <jra@samba.org>2002-07-18 23:01:44 +0000
commit687624fc187db6c07b946046e46cbbfac90aeafe (patch)
tree41866b4c3727f9b75590f351425c0de7e218cc76
parent06ae9ac5d98a752d8ca17686a4a3b1786fbe520d (diff)
downloadsamba-687624fc187db6c07b946046e46cbbfac90aeafe.tar.gz
samba-687624fc187db6c07b946046e46cbbfac90aeafe.tar.bz2
samba-687624fc187db6c07b946046e46cbbfac90aeafe.zip
Another bug found by valgrind. Don't AND a src length of -1.
Jeremy. (This used to be commit a67079882dd1b924d2e007e39b06da438533ef96)
-rw-r--r--source3/lib/charcnv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index d42dc994b0..ea5bb87bc3 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -562,7 +562,8 @@ int pull_ucs2(const void *base_ptr, char *dest, const void *src, int dest_len, i
}
/* ucs2 is always a multiple of 2 bytes */
- src_len &= ~1;
+ if (src_len != -1)
+ src_len &= ~1;
ret = convert_string(CH_UCS2, CH_UNIX, src, src_len, dest, dest_len);
if (dest_len) dest[MIN(ret, dest_len-1)] = 0;