diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2007-01-02 11:25:00 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2007-01-02 11:25:00 +0000 |
commit | 4362ff0d4b2a9feee34a595feee087d47faeb447 (patch) | |
tree | 0cd7968bf437fdb5299cdc5abb58985fcac0d0ef /src | |
parent | d606654836e3c791e69d4e5f066ef9d8e60ba035 (diff) |
Panic-die if a system filter or router generates more then 32767 child
addresses.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 5 | ||||
-rw-r--r-- | src/src/exim.h | 10 | ||||
-rw-r--r-- | src/src/routers/iplookup.c | 5 | ||||
-rw-r--r-- | src/src/routers/queryprogram.c | 5 | ||||
-rw-r--r-- | src/src/routers/redirect.c | 5 |
5 files changed, 25 insertions, 5 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c index 02552317a..6154085ed 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/deliver.c,v 1.38 2006/11/06 15:50:12 ph10 Exp $ */ +/* $Cambridge: exim/src/src/deliver.c,v 1.39 2007/01/02 11:25:00 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -4941,6 +4941,9 @@ else if (system_filter != NULL && process_recipients != RECIP_FAIL_TIMEOUT) while (p != NULL) { + if (parent->child_count == SHRT_MAX) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "system filter generated more " + "than %d delivery addresses", SHRT_MAX); parent->child_count++; p->parent = parent; diff --git a/src/src/exim.h b/src/src/exim.h index 591434312..9882ab348 100644 --- a/src/src/exim.h +++ b/src/src/exim.h @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/exim.h,v 1.19 2006/02/07 11:19:00 ph10 Exp $ */ +/* $Cambridge: exim/src/src/exim.h,v 1.20 2007/01/02 11:25:00 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -75,6 +75,14 @@ making unique names. */ #define INT_MAX 2147483647 #endif +#ifndef INT_MIN +#define INT_MIN (-INT_MAX - 1) +#endif + +#ifndef SHRT_MAX +#define SHRT_MAX 32767 +#endif + #ifndef UCHAR_MAX #define UCHAR_MAX 255 #endif diff --git a/src/src/routers/iplookup.c b/src/src/routers/iplookup.c index 069c0dda1..a0afa9d0a 100644 --- a/src/src/routers/iplookup.c +++ b/src/src/routers/iplookup.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/routers/iplookup.c,v 1.8 2006/10/09 14:36:25 ph10 Exp $ */ +/* $Cambridge: exim/src/src/routers/iplookup.c,v 1.9 2007/01/02 11:25:00 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -378,6 +378,9 @@ new_addr->parent = addr; copyflag(new_addr, addr, af_propagate); new_addr->p = addr->p; +if (addr->child_count == SHRT_MAX) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s router generated more than %d " + "child addresses for <%s>", rblock->name, SHRT_MAX, addr->address); addr->child_count++; new_addr->next = *addr_new; *addr_new = new_addr; diff --git a/src/src/routers/queryprogram.c b/src/src/routers/queryprogram.c index 1b974fc4e..ef3ae8e28 100644 --- a/src/src/routers/queryprogram.c +++ b/src/src/routers/queryprogram.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/routers/queryprogram.c,v 1.8 2006/02/07 14:05:17 ph10 Exp $ */ +/* $Cambridge: exim/src/src/routers/queryprogram.c,v 1.9 2007/01/02 11:25:00 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -122,6 +122,9 @@ while (generated != NULL) next->next = *addr_new; *addr_new = next; + if (addr->child_count == SHRT_MAX) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s router generated more than %d " + "child addresses for <%s>", rblock->name, SHRT_MAX, addr->address); addr->child_count++; DEBUG(D_route) diff --git a/src/src/routers/redirect.c b/src/src/routers/redirect.c index e22699216..2c515d8fa 100644 --- a/src/src/routers/redirect.c +++ b/src/src/routers/redirect.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/routers/redirect.c,v 1.18 2006/11/20 11:43:40 ph10 Exp $ */ +/* $Cambridge: exim/src/src/routers/redirect.c,v 1.19 2007/01/02 11:25:00 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -334,6 +334,9 @@ while (generated != NULL) next->parent = addr; orflag(next, addr, af_ignore_error); next->start_router = rblock->redirect_router; + if (addr->child_count == SHRT_MAX) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s router generated more than %d " + "child addresses for <%s>", rblock->name, SHRT_MAX, addr->address); addr->child_count++; next->next = *addr_new; |