Skip to content

Bug: VirusTotal domain_report() can return None causing TypeError #112

@atenreiro

Description

@atenreiro

Description

The domain_report() method can return None in certain conditions, causing a TypeError when the caller tries to index the result.

Location

  • File: vt.py, lines 62-101
  • Caller: opensquat.py, lines 106-110

Problem

When calling vt.VirusTotal().main(domain):

total_votes = vt.VirusTotal().main(domain)
harmless = total_votes[0]  # TypeError if total_votes is None
malicious = total_votes[1]

The domain_report() method returns None if the API response is 200 but the expected data structure is missing.

Suggested Fix

  1. Return a default value like [0, -1] when data is missing
  2. Or add None check in the caller before indexing

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions