Skip to content

IndexError caused by malformed DNS packet #39

Description

@readycool

Stack trace:

File "/opt/homebrew/lib/python3.10/site-packages/spf.py", line 595, in check
  spf = self.dns_spf(self.d)
File "/opt/homebrew/lib/python3.10/site-packages/spf.py", line 1164, in dns_spf
  a = [t for t in self.dns_txt(domain) if RE_SPF.match(t)]
File "/opt/homebrew/lib/python3.10/site-packages/spf.py", line 1219, in dns_txt
  if isinstance(a[0],bytes):
IndexError: list index out of range

Steps to reproduce:

- Python 3.10.4
- dnspython 2.2.1
- pyspf 2.0.14

python spf.py 0.0.0.0 example@openprocurement.io openprocurement.io

DiG 9.10.6 output:

dig openprocurement.io TXT
;; Warning: Message parser reports malformed message packet.
;; WARNING: Message has 11 extra bytes at end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions