Skip to content

Commit

Permalink
fix: indefinite recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
jformacek committed Feb 4, 2025
1 parent 1820d98 commit 51b36c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SpfAnalyzer/SpfRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public static List<SpfRecord> Parse(string domain, string source, string rawReco
{
var includeDomain = part.Substring(8);
record._entries.Add(new SpfEntry(domain, source, "include", includeDomain));
if (retVal.Where(x => string.Equals(x.Source, source, StringComparison.OrdinalIgnoreCase)).Count() == 1)
//prevent infinite recursion
if (retVal.Where(x => string.Equals(x.Source, includeDomain, StringComparison.OrdinalIgnoreCase)).Count() == 0)
{
var additionalRecords = Dns.GetSpfRecord(includeDomain);
foreach (var additionalRecord in additionalRecords)
Expand Down

0 comments on commit 51b36c2

Please sign in to comment.