From: Wietse Venema Date: Mon, 17 Sep 2001 05:00:00 +0000 (-0500) Subject: postfix-20010228-pl05 X-Git-Tag: v20010228-pl05^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c26a9f04fd9193a2a873e1616f54147b58dd990e;p=thirdparty%2Fpostfix.git postfix-20010228-pl05 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index ab2d0fbb5..870ad53ef 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -5096,3 +5096,16 @@ Apologies for any names omitted. of hostnames in $inet_interfaces, so that Postfix does not suddenly refuse to start up after someone changes the DNS. Files: util/inet_addr_list.c global/own_inet_addr.c. + +20010917 + + Bugfix: an address extension could be appended multiple + times to the result of a canonical or virtual map lookup. + File: global/mail_addr_map.c. Fix by Victor Duchovni, + Morgan Stanley. + + Bugfix: because split_addr() would split an address even + when there was no data before the recipient delimiter, the + above bug could cause an address to grow exponentially in + size. Problem reported by Victor Duchovni, Morgan Stanley. + File: global/split_addr.c. diff --git a/postfix/src/global/mail_addr_map.c b/postfix/src/global/mail_addr_map.c index 5146eb080..8e6932a7b 100644 --- a/postfix/src/global/mail_addr_map.c +++ b/postfix/src/global/mail_addr_map.c @@ -98,6 +98,24 @@ ARGV *mail_addr_map(MAPS *path, const char *address, int propagate) vstring_strcpy(buffer, address); vstring_strcat(buffer, string); string = STR(buffer); + + /* + * The above code copies the address, including address + * extension, to the result. Discard the address extension at + * this point, to prevent a second address extension copy by + * mail_addr_crunch() below. Fix by Victor Duchovni, Morgan + * Stanley. + * + * In combination with an obscure bug in the split_addr() routine + * that mis-parsed an address without information before the + * extension, this could result in the exponential growth of the + * size of an address. Problem reported by Victor Duchovni, + * Morgan Stanley. + */ + if (extension) { + myfree(extension); + extension = 0; + } } /* @@ -159,6 +177,7 @@ int main(int argc, char **argv) */ mail_conf_read(); msg_verbose = 1; + var_rcpt_delim = "+"; if (chdir(var_queue_dir) < 0) msg_fatal("chdir %s: %m", var_queue_dir); path = maps_create(argv[0], argv[1], DICT_FLAG_LOCK); diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 4ccf192f8..e1ff53b6d 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Postfix-20010228-pl04" +#define DEF_MAIL_VERSION "Postfix-20010228-pl05" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/global/split_addr.c b/postfix/src/global/split_addr.c index d9db5777b..5f5fb4b97 100644 --- a/postfix/src/global/split_addr.c +++ b/postfix/src/global/split_addr.c @@ -76,7 +76,8 @@ char *split_addr(char *localpart, int delimiter) } /* - * Safe to split this address. + * Safe to split this address. Do not split the address if the result + * would have a null localpart. */ - return (split_at(localpart, delimiter)); + return (delimiter == *localpart ? 0 : split_at(localpart, delimiter)); }