From 687624fc187db6c07b946046e46cbbfac90aeafe Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Jul 2002 23:01:44 +0000 Subject: Another bug found by valgrind. Don't AND a src length of -1. Jeremy. (This used to be commit a67079882dd1b924d2e007e39b06da438533ef96) --- source3/lib/charcnv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') 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; -- cgit