File libsasl_encode64_termination.dif of Package libsasl2-2.3289

Index: lib/saslutil.c
===================================================================
--- lib/saslutil.c.orig
+++ lib/saslutil.c
@@ -127,7 +127,7 @@ int sasl_encode64(const char *_in, unsig
     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 @@ int sasl_encode64(const char *_in, unsig
         *out++ = '=';
     }
 
-    if (olen < outmax)
-      *out = '\0';
+    *out = '\0';
     
     return SASL_OK;
 }
openSUSE Build Service is sponsored by