[exim-cvs] Second SPF fix, moved to where type is correct.

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Exim Git Commits Mailing List
Fecha:  
A: exim-cvs
Asunto: [exim-cvs] Second SPF fix, moved to where type is correct.
Gitweb: http://git.exim.org/exim.git/commitdiff/542bc632dd2ab452f87e0304e3356534e49f71f3
Commit:     542bc632dd2ab452f87e0304e3356534e49f71f3
Parent:     7390e768d82239b8dc6697379277c37c8c927b9d
Author:     Phil Pennock <pdp@???>
AuthorDate: Fri May 18 15:52:08 2012 -0400
Committer:  Phil Pennock <pdp@???>
CommitDate: Fri May 18 15:52:08 2012 -0400


    Second SPF fix, moved to where type is correct.


    De-initialised "type" var in stack declaration, so a repeat of this mistake
    would lead to an uninitialized variable usage warning which would have blocked
    the previous incorrect fix from being committed.
---
 src/src/lookups/dnsdb.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)


diff --git a/src/src/lookups/dnsdb.c b/src/src/lookups/dnsdb.c
index be090cf..0bbc86a 100644
--- a/src/src/lookups/dnsdb.c
+++ b/src/src/lookups/dnsdb.c
@@ -122,7 +122,7 @@ int size = 256;
int ptr = 0;
int sep = 0;
int defer_mode = PASS;
-int type = T_TXT;
+int type;
int failrc = FAIL;
uschar *outsep = US"\n";
uschar *outsep2 = NULL;
@@ -164,14 +164,6 @@ if (*keystring == '>')
while (isspace(*keystring)) keystring++;
}

-/* SPF strings should be concatenated without a separator, thus make
-it the default if not defined (see RFC 4408 section 3.1.3).
-Multiple SPF records are forbidden (section 3.1.2) but are currently
-not handled specially, thus they are concatenated with \n by default. */
-
-if (type == T_SPF && outsep2 == NULL)
- outsep2 = US"";
-
/* Check for a defer behaviour keyword. */

if (strncmpic(keystring, US"defer_", 6) == 0)
@@ -206,8 +198,10 @@ if (strncmpic(keystring, US"defer_", 6) == 0)
while (isspace(*keystring)) keystring++;
}

-/* If the keystring contains an = this must be preceded by a valid type name. */
+/* Figure out the "type" value if it is not T_TXT.
+If the keystring contains an = this must be preceded by a valid type name. */

+type = T_TXT;
 if ((equals = Ustrchr(keystring, '=')) != NULL)
   {
   int i, len;
@@ -255,6 +249,14 @@ if (type == T_PTR && keystring[0] != '<' &&
     string_is_ip_address(keystring, NULL) != 0)
   sep = -1;


+/* SPF strings should be concatenated without a separator, thus make
+it the default if not defined (see RFC 4408 section 3.1.3).
+Multiple SPF records are forbidden (section 3.1.2) but are currently
+not handled specially, thus they are concatenated with \n by default. */
+
+if (type == T_SPF && outsep2 == NULL)
+ outsep2 = US"";
+
/* Now scan the list and do a lookup for each item */

while ((domain = string_nextinlist(&keystring, &sep, buffer, sizeof(buffer)))