#! /bin/sh /usr/share/dpatch/dpatch-run ## 0015_saslutil_decode64_fix.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: decode64 is not a complete implementation of the base64 spec. ## DP: This patch fixes the case where no padding characters are needed ## DP: but the input string is terminated by CRLF. @DPATCH@ diff -urNad trunk~/lib/saslutil.c trunk/lib/saslutil.c --- trunk~/lib/saslutil.c 2006-12-01 13:52:33.000000000 +0200 +++ trunk/lib/saslutil.c 2006-12-01 13:54:49.000000000 +0200 @@ -222,12 +222,14 @@ } if (inlen != 0) { - if (saw_equal) { - /* Unless there is CRLF at the end? */ - return SASL_BADPROT; - } else { - return (SASL_CONTINUE); - } + /* check for trailing CRLF */ + if (inlen != 2 && in[0] != '\r' && in[1] != '\n') { + if (saw_equal) { + return SASL_BADPROT; + } else { + return (SASL_CONTINUE); + } + } } *out = '\0'; /* NUL terminate the output string */