diff options
author | Volker Lendecke <vlendec@samba.org> | 2004-01-23 12:07:28 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2004-01-23 12:07:28 +0000 |
commit | 72d68bb58cc8cd5d80397f037bb2d1c1ae49415c (patch) | |
tree | 70e99069c442c437655d1f9562316f4432e623f8 /source3/lib | |
parent | d3f269cd833c7452776008881ec1f1b695e0eabf (diff) | |
download | samba-72d68bb58cc8cd5d80397f037bb2d1c1ae49415c.tar.gz samba-72d68bb58cc8cd5d80397f037bb2d1c1ae49415c.tar.bz2 samba-72d68bb58cc8cd5d80397f037bb2d1c1ae49415c.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 3fda2a0432a1dc7a0d28d83e35f6329bc30378e0)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_str.c | 2 |
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; |