Bug#400955: base 64 decode problems

Fabian Fagerholm fabbe at paniq.net
Tue Dec 5 10:30:15 CET 2006


On Tue, 2006-12-05 at 10:02 +0100, Michele Baldessari wrote:
> The previous version had "inlen != 2" test which doesn't really make
> much sense since we are checking the two next characters, so we need to
> guarantee their presence.

Correct, I made a typo there.

> I also added a second check for trailing of 
> single '\r' and '\n' only, which was why it was barfing on my testcase
> with sasl-simple-client.

Good to see that you came to the same conclusion independently! :)

My patch has all the checks in one if clause, so it doesn't duplicate
the check for saw_equal. It also catches the case where inlen is not 1
or 2 after the > 0 check -- it could be 3 after the decoding while loop
(the while condition is inlen > 3) in which case it's either a
protocol / alignment error or a partial base64 block. Perhaps it's also
a little bit easier to understand since all conditions are positive.
Other than these differences, your patch seems to be equivalent.

Yours is prettier, though, but I'm afraid that's secondary. :)

If you see any mistakes in my patch, then please yell! An upload will be
made within a day or two.

Cheers,
-- 
Fabian Fagerholm <fabbe at paniq.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/pkg-cyrus-sasl2-debian-devel/attachments/20061205/e35e5cf4/attachment.pgp


More information about the Pkg-cyrus-sasl2-debian-devel mailing list