diff options
author | Jeremy Allison <jra@samba.org> | 2002-07-18 23:01:44 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-07-18 23:01:44 +0000 |
commit | a67079882dd1b924d2e007e39b06da438533ef96 (patch) | |
tree | 44ccd9b16b28a4b32d5b94d72f598a9710abf237 | |
parent | a43d9788fa8823d678ee72470421b980165ec2b0 (diff) | |
download | samba-a67079882dd1b924d2e007e39b06da438533ef96.tar.gz samba-a67079882dd1b924d2e007e39b06da438533ef96.tar.xz samba-a67079882dd1b924d2e007e39b06da438533ef96.zip |
Another bug found by valgrind. Don't AND a src length of -1.
Jeremy.
-rw-r--r-- | source/lib/charcnv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c index d42dc994b00..ea5bb87bc38 100644 --- a/source/lib/charcnv.c +++ b/source/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; |