[exim-cvs] Fix crash in SPF DNS usage

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Exim Git Commits Mailing List
Fecha:  
A: exim-cvs
Asunto: [exim-cvs] Fix crash in SPF DNS usage
Gitweb: https://git.exim.org/exim.git/commitdiff/35916b2f03491ce505f69b15096bfd8d00e08286
Commit:     35916b2f03491ce505f69b15096bfd8d00e08286
Parent:     7b3b8d1195f89869199d78db2d8b357a6f0ca473
Author:     Simon Arlott <sa.me.uk>
AuthorDate: Tue Oct 10 12:31:58 2023 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Oct 10 12:31:58 2023 +0100


    Fix crash in SPF DNS usage


    Broken-by: 8ab9474f0355
---
 src/src/spf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/src/src/spf.c b/src/src/spf.c
index 100e22243..ef55520b1 100644
--- a/src/src/spf.c
+++ b/src/src/spf.c
@@ -97,7 +97,8 @@ switch (dns_lookup(dnsa, US domain, rr_type, NULL))
     srr.herrno = NETDB_SUCCESS;
     for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr;
      rr = dns_next_rr(dnsa, &dnss, RESET_NEXT))
-      if (rr->type == rr_type) { found++; break; }
+      /* Need to alloc space for all records, so no early-out */
+      if (rr->type == rr_type) found++;
     break;
   }



--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/