--- cyrus-sasl-2.1.22/lib/saslutil.c 2009/04/17 06:04:50 1.48 +++ cyrus-sasl-2.1.22/lib/saslutil.c 2009/04/27 13:26:27 1.49 @@ -1,7 +1,7 @@ /* saslutil.c * Rob Siemborski * Tim Martin - * $Id: saslutil.c,v 1.44 2006/03/13 18:26:36 mel Exp $ + * $Id: saslutil.c,v 1.49 2009/04/27 13:26:27 murch Exp $ */ /* * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved. @@ -127,7 +127,7 @@ olen = (inlen + 2) / 3 * 4; if (outlen) *outlen = olen; - if (outmax < olen) + if (outmax <= olen) return SASL_BUFOVER; /* Do the work... */ @@ -151,8 +151,7 @@ *out++ = '='; } - if (olen < outmax) - *out = '\0'; + *out = '\0'; return SASL_OK; }