From ffd3e7940955c411e6ea6f8cac412df1eda91f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 5 Aug 2021 11:50:33 +0200 Subject: [PATCH] Fixed cleanup crash when processing messages with whitespace only fullname Resolves: rhbz#1978901 --- postfix-3.5.9-whitespace-name-fix.patch | 13 +++++++++++++ postfix.spec | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 postfix-3.5.9-whitespace-name-fix.patch diff --git a/postfix-3.5.9-whitespace-name-fix.patch b/postfix-3.5.9-whitespace-name-fix.patch new file mode 100644 index 0000000..c45035e --- /dev/null +++ b/postfix-3.5.9-whitespace-name-fix.patch @@ -0,0 +1,13 @@ +diff --git a/src/cleanup/cleanup_message.c b/src/cleanup/cleanup_message.c +index 391c711..be5ce42 100644 +--- a/src/cleanup/cleanup_message.c ++++ b/src/cleanup/cleanup_message.c +@@ -773,6 +773,8 @@ static void cleanup_header_done_callback(void *context) + /* Normalize whitespace. */ + token = tok822_scan_limit(state->fullname, &dummy_token, + var_token_limit); ++ if (!token) ++ token = tok822_alloc(TOK822_QSTRING, state->fullname); + } else { + token = tok822_alloc(TOK822_QSTRING, state->fullname); + } diff --git a/postfix.spec b/postfix.spec index a8488fd..e180a06 100644 --- a/postfix.spec +++ b/postfix.spec @@ -49,7 +49,7 @@ Name: postfix Summary: Postfix Mail Transport Agent Version: 3.5.9 -Release: 13%{?dist} +Release: 14%{?dist} Epoch: 2 URL: http://www.postfix.org License: (IBM and GPLv2+) or (EPL-2.0 and GPLv2+) @@ -98,6 +98,8 @@ Patch11: postfix-3.4.4-chroot-example-fix.patch # in RHEL-9 this feature was also backported to 2.33, # upstream uses conditional check for 2.34 API Patch12: postfix-3.5.9-glibc-234-build-fix.patch +# rhbz#1978901, sent upstream +Patch13: postfix-3.5.9-whitespace-name-fix.patch # Optional patches - set the appropriate environment variables to include # them when building the package/spec file @@ -249,6 +251,7 @@ popd %endif %patch11 -p1 -b .chroot-example-fix %patch12 -p1 -b .glibc-234-build-fix +%patch13 -p1 -b .whitespace-name-fix for f in README_FILES/TLS_{LEGACY_,}README TLS_ACKNOWLEDGEMENTS; do iconv -f iso8859-1 -t utf8 -o ${f}{_,} && @@ -792,6 +795,10 @@ fi %endif %changelog +* Thu Aug 5 2021 Jaroslav Škarvada - 2:3.5.9-14 +- Fixed cleanup crash when processing messages with whitespace only fullname + Resolves: rhbz#1978901 + * Thu Aug 5 2021 Jaroslav Škarvada - 2:3.5.9-13 - Used upstream patch for fixing FTBFS with glibc-2.34 Related: rhbz#1984045