From 4681b57adc9da6e77c2cdd08351cdb47c1568f57 Mon Sep 17 00:00:00 2001 From: Rory Flynn <75283103+roaree@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:30:27 +0100 Subject: [PATCH] Handle no indicators provided in `sms_attachments.py` (#455) * Handle no indicators provided in `sms_attachments.py` * Move guard to a more specific place * Unrelated black formatting * Related black changes :) --- mvt/ios/modules/mixed/calls.py | 6 +++--- mvt/ios/modules/mixed/sms_attachments.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mvt/ios/modules/mixed/calls.py b/mvt/ios/modules/mixed/calls.py index 32f44a5..e29be35 100644 --- a/mvt/ios/modules/mixed/calls.py +++ b/mvt/ios/modules/mixed/calls.py @@ -69,9 +69,9 @@ class Calls(IOSExtraction): "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], } ) diff --git a/mvt/ios/modules/mixed/sms_attachments.py b/mvt/ios/modules/mixed/sms_attachments.py index f6f3d22..ea9b477 100644 --- a/mvt/ios/modules/mixed/sms_attachments.py +++ b/mvt/ios/modules/mixed/sms_attachments.py @@ -56,7 +56,9 @@ class SMSAttachments(IOSExtraction): 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 (