From 642dbb87e9ab3dfa02a300f61a810d768c8f0473 Mon Sep 17 00:00:00 2001 From: niftylettuce Date: Thu, 6 Aug 2020 13:49:43 -0500 Subject: [PATCH] fix: fixed length check to prevent exception (thanks @jordan-cahill) --- authheaders/dmarc_lookup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authheaders/dmarc_lookup.py b/authheaders/dmarc_lookup.py index cd555cb..77117ae 100644 --- a/authheaders/dmarc_lookup.py +++ b/authheaders/dmarc_lookup.py @@ -38,7 +38,7 @@ def answer_to_dict(answer): '''Turn the DNS DMARC answer into a dict of tag:value pairs.''' a = answer.strip('"').strip(' ') rawTags = [t.split('=') for t in a.split(';') if t] - retval = {t[0].strip(): t[1].strip() for t in rawTags} + retval = {t[0].strip(): t[1].strip() for t in rawTags if len(t) == 2} return retval def dns_query(name, qtype='TXT'):