summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-07-10 17:29:22 +0200
committerVolker Lendecke <vl@samba.org>2009-07-10 18:16:46 +0200
commit0a0bff353e3cd8287166c7ed907a50a8599b0e03 (patch)
tree6a6fcbbf81d28e4796cf63f4a268633be8afc40c /source3/lib
parent67c7b7f90bd1bad265e892bb00abf649b22345b6 (diff)
downloadsamba-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.c2
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++;