diff options
author | Volker Lendecke <vl@samba.org> | 2009-07-10 17:29:22 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-07-10 18:16:46 +0200 |
commit | 0a0bff353e3cd8287166c7ed907a50a8599b0e03 (patch) | |
tree | 6a6fcbbf81d28e4796cf63f4a268633be8afc40c /source3/lib | |
parent | 67c7b7f90bd1bad265e892bb00abf649b22345b6 (diff) | |
download | samba-0a0bff353e3cd8287166c7ed907a50a8599b0e03.tar.gz samba-0a0bff353e3cd8287166c7ed907a50a8599b0e03.tar.bz2 samba-0a0bff353e3cd8287166c7ed907a50a8599b0e03.zip |
Fix our base64 implementation for blobs of length 4....
The additional length check bit us exactly at 4, removing it. The
torture test survives valgrind up to 2000 bytes :-)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_str.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index cdd7d0a300..0aff9439e9 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -1932,7 +1932,7 @@ char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data) result = TALLOC_ARRAY(mem_ctx, char, output_len); /* get us plenty of space */ SMB_ASSERT(result != NULL); - while (len-- && out_cnt < (data.length * 2) - 5) { + while (len--) { int c = (unsigned char) *(data.data++); bits += c; char_count++; |