From 8c2e22e2531bba16409adbecf3d5c06862f79826 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 571c3b2b1d..76b0b04476 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10186,7 +10186,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 174.0.1; + version = "174.0.1-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 32c4b77aaa..6876ae2678 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" : "63195a30b02e05d1b7176c76ebc55c2cff66c9c8", - "version" : "174.0.1" + "revision" : "13aadd233d699ca9d882bd238b6bb2f6353c6fd6", + "version" : "174.0.1-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