summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-01-23 12:04:07 +0000
committerVolker Lendecke <vlendec@samba.org>2004-01-23 12:04:07 +0000
commitaa7a675025bc63ce0300b0e5bcf4a3a3849d2833 (patch)
treee539e3726941f703463610e8456e088176c5dc67
parent8975dde0045f9b92c6eaa90a0c381b2baf9e3bd3 (diff)
downloadsamba-aa7a675025bc63ce0300b0e5bcf4a3a3849d2833.tar.gz
samba-aa7a675025bc63ce0300b0e5bcf4a3a3849d2833.tar.bz2
samba-aa7a675025bc63ce0300b0e5bcf4a3a3849d2833.zip
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)
-rw-r--r--source3/lib/util_str.c2
1 files changed, 2 insertions, 0 deletions
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;