From 8fd9df6ec02e332d99f0822a7c3e00cd8ac8d284 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Tue, 23 Jul 2024 20:29:08 +0600 Subject: [PATCH] fix index out-of-bounds in startAttachingCrashLogMessages (#3123) Task/Issue URL: https://app.asana.com/0/414709148257752/1207877553454228/f BSK PR: duckduckgo/BrowserServicesKit#906 Description: Fixes Out-of-bounds exception when no records in crashDiagnostics array Rollback crash collection in C++ exception handler Steps to test this PR: Simulate a crash in App Store target with debugger detached Set a breakpoint at CrashCollection.swift:122 and remove items from crashDiagnostics array (using LLDB: po crashDiagnostics.removeAll()) validate the code is not crashing when adding a record to the array --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- DuckDuckGo/AppDelegate.swift | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 679f2e09ed..ef1c629465 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10118,7 +10118,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 171.2.0; + version = "171.2.0-1"; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3eea7ded49..74aa7288f1 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "a3bd039e78e75e0ad36dffbf1874b555738f22af", - "version" : "171.2.0" + "revision" : "8adaa843affde9167bd2a987eed6b73f54524232", + "version" : "171.2.0-1" } }, { diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index 69dc0b2f90..eecf383aac 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -106,12 +106,6 @@ import WebKit override init() { super.init() - - if !didCrashDuringCrashHandlersSetUp { - didCrashDuringCrashHandlersSetUp = true - CrashLogMessageExtractor.setUp() - didCrashDuringCrashHandlersSetUp = false - } } // swiftlint:disable:next function_body_length