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 and bwaresiak committed Jul 23, 2024
1 parent dac3a9f commit 8c2e22e
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 @@ -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" */ = {
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" : "63195a30b02e05d1b7176c76ebc55c2cff66c9c8",
"version" : "174.0.1"
"revision" : "13aadd233d699ca9d882bd238b6bb2f6353c6fd6",
"version" : "174.0.1-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 8c2e22e

Please sign in to comment.