From 72d68bb58cc8cd5d80397f037bb2d1c1ae49415c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 23 Jan 2004 12:07:28 +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 3fda2a0432a1dc7a0d28d83e35f6329bc30378e0) --- source3/lib/util_str.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3') 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