]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.12-20150120
authorWietse Venema <wietse@porcupine.org>
Tue, 20 Jan 2015 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Wed, 21 Jan 2015 07:41:40 +0000 (02:41 -0500)
postfix/HISTORY
postfix/WISHLIST
postfix/src/global/mail_version.h
postfix/src/util/dict.h
postfix/src/util/dict_alloc.c
postfix/src/util/dict_utf8.c

index 950281132c8c91b2130f0bc13b4c612cff218513..655f62d5a39f6339f3199a71f85dc1d2b5f4fb86 100644 (file)
@@ -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.
index 9262c9904d91b733e7e1e9f7be1337ea3f630289..2c40daa3e7180c5f9590c64756cadd085755cbc9 100644 (file)
@@ -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.
 
index 8205d448d521c77349e17116d8b588b66bf8e56a..6820a9515f5e72f1810e166e12432de174c8d563 100644 (file)
@@ -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
index 0c3c464a60739188f6b1a9857e7eb640c91614d9..b71a688588a18e97be2c321b57baf2c7b6b0b038 100644 (file)
@@ -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 *);
index 094e2193a6152dc0c97763ab2dc98ae8829063e1..653646b9aded62a760dc1c1fd3f71881a4ddfbbf 100644 (file)
@@ -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);
index 17fe06131f2961bdc9d4bc0c3bf4311a6260945c..c3eb4057fd9ec2b3f33133ed03b7b2f527f198b1 100644 (file)
 #include <mymalloc.h>
 #include <msg.h>
 
- /*
-  * 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;
 
     /*