From: Guido Kiener <guido@kiener-muenchen.de>
Date: Mon, 25 Jan 2021 17:57:02 +0100
Subject: Fix _sasl_add_string
Origin: https://github.com/cyrusimap/cyrus-sasl/commit/5ac1beeb574cd9d0a518d72330b19d2460688089

Issue #587 was not solved correct.

_sasl_add_string adds zero terminator to the output string.
This cuts log messages after the first '%s' of the format string.
With the fix the function _sasl_log now logs the complete message.

Signed-off-by: Guido Kiener <guido@kiener-muenchen.de>
---
 lib/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/common.c b/lib/common.c
index d1b028fe6714..deb94eec7070 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -195,7 +195,7 @@ int _sasl_add_string(char **out, size_t *alloclen,
     return SASL_NOMEM;
 
   strncpy(*out + *outlen, add, addlen);
-  *outlen += addlen;
+  *outlen += addlen-1;
 
   return SASL_OK;
 }
-- 
2.34.1

