[PATCH] Re: [Exim] negative integer options gone in 4.20, ca…

Top Page
Delete this message
Reply to this message
Author: Torsten Luettgert
Date:  
To: exim-users
Subject: [PATCH] Re: [Exim] negative integer options gone in 4.20, causing some grief
Hello again,

feeling slightly schizophrenic, I'm answering to myself.
Here's a patch for the mentioned problem.

- Torsten

diff -urN exim-4.20.orig/src/readconf.c exim-4.20/src/readconf.c
--- exim-4.20.orig/src/readconf.c       Mon May 12 15:39:21 2003
+++ exim-4.20/src/readconf.c    Fri Jul 11 13:56:28 2003
@@ -1619,11 +1619,14 @@
     log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "%sinteger expected for
%s",
       inttype, name);


-  if (tolower(s[count]) == 'k') { value *= 1024; count++; }
-  else if (tolower(s[count]) == 'm') { value *= 1024*1024; count++; }
+  {
+    int ov = value;
+    if (tolower(s[count]) == 'k') { value *= 1024; count++; }
+    else if (tolower(s[count]) == 'm') { value *= 1024*1024; count++; }


-  if (value < 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
-    "integer \"%s\" is too large (overflow)", s);
+    if (value < 0 && ov > 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
+      "integer \"%s\" is too large (overflow)", s);
+  }


while (isspace(s[count])) count++;
if (s[count] != 0)