From 0a0bff353e3cd8287166c7ed907a50a8599b0e03 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 10 Jul 2009 17:29:22 +0200 Subject: 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 :-) --- source3/lib/util_str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib') 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++; -- cgit