From aa7a675025bc63ce0300b0e5bcf4a3a3849d2833 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 23 Jan 2004 12:04:07 +0000 Subject: Fix decoding of base64. We got the length wrong when the result was not an exact multiple of 3. I also wrote a torture test and it survived some minutes of random stuff coded/decoded up to 16 MB data. But that would be a bit too embarassing to commit... :-) Volker (This used to be commit 6d22f0d8c36bea618ad0adf4eefc2f5a37cb3fda) --- source3/lib/util_str.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index d93f39696f..822ab20628 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -1838,6 +1838,8 @@ DATA_BLOB base64_decode_data_blob(const char *s) s++; i++; } + if (*s == '=') n -= 1; + /* fix up length */ decoded.length = n; return decoded; -- cgit