Skip to content

Commit

Permalink
Handle no indicators provided in sms_attachments.py (#455)
Browse files Browse the repository at this point in the history
* Handle no indicators provided in `sms_attachments.py`

* Move guard to a more specific place

* Unrelated black formatting

* Related black changes :)
  • Loading branch information
roaree authored Feb 7, 2024
1 parent bb7a22e commit 4681b57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mvt/ios/modules/mixed/calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def run(self) -> None:
"isodate": convert_mactime_to_iso(row[0]),
"duration": row[1],
"location": row[2],
"number": row[3].decode("utf-8")
if row[3] and row[3] is bytes
else row[3],
"number": (
row[3].decode("utf-8") if row[3] and row[3] is bytes else row[3]
),
"provider": row[4],
}
)
Expand Down
4 changes: 3 additions & 1 deletion mvt/ios/modules/mixed/sms_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def serialize(self, record: dict) -> Union[dict, list]:
def check_indicators(self) -> None:
for attachment in self.results:
# Check for known malicious filenames.
if self.indicators.check_file_path(attachment["filename"]):
if self.indicators and self.indicators.check_file_path(
attachment["filename"]
):
self.detected.append(attachment)

if (
Expand Down

0 comments on commit 4681b57

Please sign in to comment.