From 6f10a066504ecbf76e0acebde7f9ac33467fb1d7 Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Wed, 7 Jul 2021 00:00:00 -0500 Subject: [PATCH] postfix-3.7-20210707 --- postfix/HISTORY | 11 +++++++++++ postfix/src/cleanup/cleanup_message.c | 9 ++++++--- postfix/src/global/mail_version.h | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index 4e60ec2c1..9f1991190 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -25650,3 +25650,14 @@ Apologies for any names omitted. strtou?l() can be migrated later. Problem reported by David Bohman. Files: util/sane_strtol.[hc], global/compat_level.c, postscreen/postscreen_tests.c, util/mac_expand.c. + +20210705 + + Bugfix (introduced: Postfix 3.3): with "header_from_format + = standard" (the default as of Postfix 3.3) the cleanup + daemon crashed with a "null pointer read" error when email + was submitted with /usr/sbin/sendmail without From: header, + and an all-space full name was specified in the password + file, with "sendmail -F", or with the NAME environment + variable. Found by Renaud Metrich. File: + cleanup/cleanup_message.c. diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c index 391c7119f..902642f19 100644 --- a/postfix/src/cleanup/cleanup_message.c +++ b/postfix/src/cleanup/cleanup_message.c @@ -776,9 +776,12 @@ static void cleanup_header_done_callback(void *context) } else { token = tok822_alloc(TOK822_QSTRING, state->fullname); } - tok822_externalize(state->temp2, token, TOK822_STR_NONE); - tok822_free(token); - vstring_sprintf_append(state->temp2, " <%s>", + if (token) { + tok822_externalize(state->temp2, token, TOK822_STR_NONE); + tok822_free(token); + vstring_strcat(state->temp2, " "); + } + vstring_sprintf_append(state->temp2, "<%s>", vstring_str(state->temp1)); break; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index d7a25e60c..f4f71a6a1 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20210627" +#define MAIL_RELEASE_DATE "20210707" #define MAIL_VERSION_NUMBER "3.7" #ifdef SNAPSHOT