diff --git a/postfix/HISTORY b/postfix/HISTORY index 950281132..655f62d5a 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -21426,3 +21426,10 @@ Apologies for any names omitted. even when the client did not send any. This helps logfile analyzers to recognize sessions without commands. File: smtpd/smtpd.c. + +20150120 + + Bugfix (introduced: 20141230-20140109): do not reallocate + a dictionary handle after it is initialized. This breaks + CDB. Problem reported by Andreas Schulze. Files: util/dict.h, + util/dict_alloc.c, util/dict_utf8.c. diff --git a/postfix/WISHLIST b/postfix/WISHLIST index 9262c9904..2c40daa3e 100644 --- a/postfix/WISHLIST +++ b/postfix/WISHLIST @@ -8,9 +8,18 @@ Wish list: Things to do after the stable release: + Back out check_dict_get() because the longjmp() calls + introduce memory leaks upstream. + postconf -P: emit '{ name = value }' when editing/adding a parameter whose new value contains whitespace. + Fix the ad-hoc lowercase() calls that silently assume an + adress or localpart is ASCII: smtpd/smtpd_resolve.c, + local/forward.c, local/recipient.c, ... Are we supposed to + throw an error when casefold() fails? How do we know that + an error is permanent or just a shortage of resources? + In release-notes add commands=x/y logging to the command statistics. diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 8205d448d..6820a9515 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 "20150118" +#define MAIL_RELEASE_DATE "20150120" #define MAIL_VERSION_NUMBER "2.12" #ifdef SNAPSHOT diff --git a/postfix/src/util/dict.h b/postfix/src/util/dict.h index 0c3c464a6..b71a68858 100644 --- a/postfix/src/util/dict.h +++ b/postfix/src/util/dict.h @@ -249,6 +249,12 @@ extern void dict_type_override(DICT *, const char *); /* * Check and convert UTF-8 keys and values. */ +typedef struct { + const char *(*lookup) (struct DICT *, const char *); + int (*update) (struct DICT *, const char *, const char *); + int (*delete) (struct DICT *, const char *); +} DICT_UTF8_BACKUP; + extern DICT *dict_utf8_activate(DICT *); extern char *dict_utf8_check_fold(DICT *, const char *, CONST_CHAR_STAR *); extern int dict_utf8_check(const char *, CONST_CHAR_STAR *); diff --git a/postfix/src/util/dict_alloc.c b/postfix/src/util/dict_alloc.c index 094e2193a..653646b9a 100644 --- a/postfix/src/util/dict_alloc.c +++ b/postfix/src/util/dict_alloc.c @@ -134,7 +134,9 @@ static void dict_default_close(DICT *dict) DICT *dict_alloc(const char *dict_type, const char *dict_name, ssize_t size) { - DICT *dict = (DICT *) mymalloc(size); + extern int util_utf8_enable; + DICT *dict = (DICT *) mymalloc(util_utf8_enable ? + size + sizeof(DICT_UTF8_BACKUP) : size); dict->type = mystrdup(dict_type); dict->name = mystrdup(dict_name); diff --git a/postfix/src/util/dict_utf8.c b/postfix/src/util/dict_utf8.c index 17fe06131..c3eb4057f 100644 --- a/postfix/src/util/dict_utf8.c +++ b/postfix/src/util/dict_utf8.c @@ -70,15 +70,6 @@ #include #include - /* - * Backed-up accessor function pointers. - */ -typedef struct { - const char *(*lookup) (struct DICT *, const char *); - int (*update) (struct DICT *, const char *, const char *); - int (*delete) (struct DICT *, const char *); -} DICT_UTF8_BACKUP; - /* * The goal is to maximize robustness: bad UTF-8 should not appear in keys, * because those are derived from controlled inputs, and values should be @@ -303,7 +294,6 @@ DICT *dict_utf8_activate(DICT *dict) * to arbitrary levels of encapsulation. That is, it does not co-exist * with dict_debug(3) which is broken for the reasons stated above. */ - dict = myrealloc(dict, dict->size + sizeof(*backup)); backup = (void *) dict + dict->size; /*