Skip to content

Commit

Permalink
fix: fixed length check to prevent exception (thanks @jordan-cahill)
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Aug 6, 2020
1 parent 93bbcb9 commit 642dbb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion authheaders/dmarc_lookup.py
Expand Up @@ -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'):
Expand Down

0 comments on commit 642dbb8

Please sign in to comment.