]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/lookups/dnsdb.c
DSN: fix null deref when bounce is due to conn-timeout. Bug 1630
[user/henk/code/exim.git] / src / src / lookups / dnsdb.c
index d06455e61f1119e90b68d43e0192cbc031cd6f4f..e3de279e25477ffadd73ea7d2f96074668b3609d 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2014 */
+/* Copyright (c) University of Cambridge 1995 - 2015 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 #include "../exim.h"
@@ -230,7 +230,7 @@ for (;;)
   else if (strncmpic(keystring, US"retry_", 6) == 0)
     {
     int retries;
-    if ((retries = (int)strtol(keystring + 6, CSS &keystring, 0)) < 0)
+    if ((retries = (int)strtol(CCS keystring + 6, CSS &keystring, 0)) < 0)
       {
       *errmsg = US"unsupported dnsdb retry count";
       return DEFER;
@@ -391,7 +391,7 @@ while ((domain = string_nextinlist(&keystring, &sep, NULL, 0)))
       if (type == T_A || type == T_AAAA || type == T_ADDRESSES)
         {
         dns_address *da;
-        for (da = dns_address_from_rr(&dnsa, rr); da != NULL; da = da->next)
+        for (da = dns_address_from_rr(&dnsa, rr); da; da = da->next)
           {
           if (ptr != 0) yield = string_cat(yield, &size, &ptr, outsep, 1);
           yield = string_cat(yield, &size, &ptr, da->address,
@@ -548,7 +548,7 @@ while ((domain = string_nextinlist(&keystring, &sep, NULL, 0)))
          p += rc;
          GETLONG(serial, p); GETLONG(refresh, p);
          GETLONG(retry,  p); GETLONG(expire,  p); GETLONG(minimum, p);
-         sprintf(CS s, "%c%d%c%d%c%d%c%d%c%d",
+         sprintf(CS s, "%c%lu%c%lu%c%lu%c%lu%c%lu",
            *outsep2, serial, *outsep2, refresh,
            *outsep2, retry,  *outsep2, expire,  *outsep2, minimum);
          yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));