From 6d22f0d8c36bea618ad0adf4eefc2f5a37cb3fda Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 23 Jan 2004 12:04:07 +0000 Subject: [PATCH] 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 --- source/lib/util_str.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/lib/util_str.c b/source/lib/util_str.c index d93f39696f4..822ab206286 100644 --- a/source/lib/util_str.c +++ b/source/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; -- 2.11.4.GIT