DKIM: use tainted mem for dns lookup
[exim.git] / src / src / readconf.c
index 52c64830e5eea5a7d6883b34b081e784dab3abf0..a5482f72dd1f193d2fdb90cd2e67dad081750cca 100644 (file)
@@ -306,7 +306,7 @@ static optionlist optionlist_config[] = {
   { "smtp_ratelimit_hosts",     opt_stringptr,   &smtp_ratelimit_hosts },
   { "smtp_ratelimit_mail",      opt_stringptr,   &smtp_ratelimit_mail },
   { "smtp_ratelimit_rcpt",      opt_stringptr,   &smtp_ratelimit_rcpt },
-  { "smtp_receive_timeout",     opt_func,        &fn_smtp_receive_timeout },
+  { "smtp_receive_timeout",     opt_func,        (void *) &fn_smtp_receive_timeout },
   { "smtp_reserve_hosts",       opt_stringptr,   &smtp_reserve_hosts },
   { "smtp_return_error_details",opt_bool,        &smtp_return_error_details },
 #ifdef SUPPORT_I18N
@@ -3326,6 +3326,19 @@ if (f.trusted_config && Ustrcmp(filename, US"/dev/null"))
 
     log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Exim configuration file %s has the "
       "wrong owner, group, or mode", big_buffer);
+
+  /* Do a dummy store-allocation of a size related to the (toplevel) file size.
+  This assumes we will need this much storage to handle all the allocations
+  during startup; it won't help when .include is being used.  When it does, it
+  will cut down on the number of store blocks (and malloc calls, and sbrk
+  syscalls).  It also assume we're on the relevant pool. */
+
+  if (statbuf.st_size > 8192)
+    {
+    rmark r = store_mark();
+    void * dummy = store_get((int)statbuf.st_size, FALSE);
+    store_reset(r);
+    }
   }
 
 /* Do a dummy store-allocation of a size related to the (toplevel) file size.
@@ -3337,7 +3350,7 @@ syscalls).  It also assume we're on the relevant pool. */
 if (statbuf.st_size > 8192)
   {
   rmark r = store_mark();
-  store_get((int)statbuf.st_size, FALSE);
+  void * dummy = store_get((int)statbuf.st_size, FALSE);
   store_reset(r);
   }