cyrus-sasl/backport-Fix-_sasl_add_string.patch
2025-04-11 11:04:48 +08:00

33 lines
883 B
Diff

From 5ac1beeb574cd9d0a518d72330b19d2460688089 Mon Sep 17 00:00:00 2001
From: Guido Kiener <guido@kiener-muenchen.de>
Date: Mon, 25 Jan 2021 17:57:02 +0100
Subject: [PATCH] Fix _sasl_add_string
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 d1b028fe..deb94eec 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.33.0