From e2c9f04b424cb6f48c31f655b39324102f1688f0 Mon Sep 17 00:00:00 2001 From: yixiangzhike Date: Fri, 11 Apr 2025 11:04:48 +0800 Subject: [PATCH] Fix _sasl_add_string --- backport-Fix-_sasl_add_string.patch | 32 +++++++++++++++++++++++++++++ cyrus-sasl.spec | 6 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-_sasl_add_string.patch diff --git a/backport-Fix-_sasl_add_string.patch b/backport-Fix-_sasl_add_string.patch new file mode 100644 index 0000000..bbeef27 --- /dev/null +++ b/backport-Fix-_sasl_add_string.patch @@ -0,0 +1,32 @@ +From 5ac1beeb574cd9d0a518d72330b19d2460688089 Mon Sep 17 00:00:00 2001 +From: Guido Kiener +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 +--- + 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 + diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index f3d1eaf..6c32906 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -6,7 +6,7 @@ Name: cyrus-sasl Version: 2.1.27 -Release: 17 +Release: 18 Summary: The Cyrus SASL API Implementation License: BSD with advertising @@ -21,6 +21,7 @@ Patch2: backport-db_gdbm-fix-gdbm_errno-overlay-from-gdbm_close.patch Patch3: backport-CVE-2022-24407-Escape-password-for-SQL-insert-update.patch Patch4: backport-Use-int-instead-of-char-for-variable-c.patch Patch5: backport-Fix-heap-corruption.patch +Patch6: backport-Fix-_sasl_add_string.patch BuildRequires: autoconf, automake, libtool, gdbm-devel, groff BuildRequires: krb5-devel >= 1.2.2, openssl-devel, pam-devel, pkgconfig @@ -328,6 +329,9 @@ getent passwd %{username} >/dev/null || useradd -r -g %{username} -d %{homedir} %changelog +* Fri Apr 11 2025 yixiangzhike - 2.1.27-18 +- backport upstream patch to fix _sasl_add_string + * Thu Dec 19 2024 yixiangzhike - 2.1.27-17 - backport upstream patch to fix heap corruption -- Gitee