diff src/context.cpp @ 428:6f2db3d19a34 stable-6-0-61

allow 4000 byte spf txt records
author Carl Byington <carl@five-ten-sg.com>
date Mon, 02 Oct 2017 15:09:55 -0700
parents c9b7b6dd1206
children 69d33c034a8e
line wrap: on
line diff
--- a/src/context.cpp	Fri Aug 18 09:59:22 2017 -0700
+++ b/src/context.cpp	Mon Oct 02 15:09:55 2017 -0700
@@ -1171,9 +1171,9 @@
 
 bool CONTEXT::resolve_one_spf(const char *from, uint32_t ip, mlfiPriv *priv, int level)
 {
-    char buf[maxlen];
+    char buf[maxdnslength];
     log(priv->queueid, "looking for %s txt record", from);
-    dns_interface(*priv, from, ns_t_txt, false, NULL, buf, maxlen);
+    dns_interface(*priv, from, ns_t_txt, false, NULL, buf, maxdnslength);
     if (*buf) {
         log(priv->queueid, "found txt record %s", buf);
         // expand some macros here - a very restricted subset of all possible spf macros
@@ -1231,8 +1231,8 @@
                 }
                 else if (strncmp(p, "exists:", 7) == 0) {
                     p += 7;
-                    char buf[maxlen];
-                    dns_interface(*priv, p, ns_t_a, false, NULL, buf, maxlen);
+                    char buf[maxdnslength];
+                    dns_interface(*priv, p, ns_t_a, false, NULL, buf, maxdnslength);
                     uint32_t *a = (uint32_t *)buf;
                     if (a[0]) {
                         log(priv->queueid, "match exists:%s", p);
@@ -1241,13 +1241,13 @@
                 }
                 else if (strncmp(p, "mx", 2) == 0) {
                     const char *name = (p[2] == ':') ? p+2 : from;
-                    char buf[maxlen];
-                    dns_interface(*priv, name, ns_t_mx, false, NULL, buf, maxlen);
+                    char buf[maxdnslength];
+                    dns_interface(*priv, name, ns_t_mx, false, NULL, buf, maxdnslength);
                     char *b = buf;
                     while (*b) {
                         log(priv->queueid, "found mx %s", b);
-                        char buf[maxlen];
-                        dns_interface(*priv, b, ns_t_a, false, NULL, buf, maxlen);
+                        char buf[maxdnslength];
+                        dns_interface(*priv, b, ns_t_a, false, NULL, buf, maxdnslength);
                         uint32_t *a = (uint32_t *)buf;
                         size_t c = a[0];
                         for (size_t i=1; i<=c; i++) {
@@ -1266,8 +1266,8 @@
                 }
                 else if (p[0] == 'a') {
                     const char *name = (p[1] == ':') ? p+2 : from;
-                    char buf[maxlen];
-                    dns_interface(*priv, name, ns_t_a, false, NULL, buf, maxlen);
+                    char buf[maxdnslength];
+                    dns_interface(*priv, name, ns_t_a, false, NULL, buf, maxdnslength);
                     uint32_t *a = (uint32_t *)buf;
                     size_t c = a[0];
                     for (size_t i=1; i<=c; i++) {