Skip to content

Commit

Permalink
fix index out-of-bounds in startAttachingCrashLogMessages (#3123)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mallexxx authored Jul 23, 2024
1 parent dcf747c commit 8fd9df6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down
6 changes: 0 additions & 6 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ import WebKit

override init() {
super.init()

if !didCrashDuringCrashHandlersSetUp {
didCrashDuringCrashHandlersSetUp = true
CrashLogMessageExtractor.setUp()
didCrashDuringCrashHandlersSetUp = false
}
}

// swiftlint:disable:next function_body_length
Expand Down

0 comments on commit 8fd9df6

Please sign in to comment.