Skip to content

Commit

Permalink
fix index out-of-bounds in startAttachingCrashLogMessages (#3006)
Browse files Browse the repository at this point in the history
  • Loading branch information
mallexxx authored Jul 23, 2024
1 parent c0ee7b0 commit 161d8d2
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13316,7 +13316,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = "171.1.1-1";
version = "171.1.1-2";
};
};
9FF521422BAA8FF300B9819B /* 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" : "eea55b8903389f680c4f08667d8f1428e12aa053",
"version" : "171.1.1-1"
"revision" : "ec7bfbcda3d18086a03d762c41382c318c699c8f",
"version" : "171.1.1-2"
}
},
{
Expand Down
18 changes: 0 additions & 18 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,25 +144,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
@UserDefaultsWrapper(key: .firstLaunchDate, defaultValue: Date.monthAgo)
static var firstLaunchDate: Date

@UserDefaultsWrapper
private var didCrashDuringCrashHandlersSetUp: Bool

static var isNewUser: Bool {
return firstLaunchDate >= Date.weekAgo
}

override init() {
// will not add crash handlers and will fire pixel on applicationDidFinishLaunching if didCrashDuringCrashHandlersSetUp == true
let didCrashDuringCrashHandlersSetUp = UserDefaultsWrapper(key: .didCrashDuringCrashHandlersSetUp, defaultValue: false)
_didCrashDuringCrashHandlersSetUp = didCrashDuringCrashHandlersSetUp
if case .normal = NSApplication.runType,
!didCrashDuringCrashHandlersSetUp.wrappedValue {

didCrashDuringCrashHandlersSetUp.wrappedValue = true
CrashLogMessageExtractor.setUp()
didCrashDuringCrashHandlersSetUp.wrappedValue = false
}

do {
let encryptionKey = NSApplication.runType.requiresEnvironment ? try keyStore.readKey() : nil
fileStore = EncryptedFileStore(encryptionKey: encryptionKey)
Expand Down Expand Up @@ -390,10 +376,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

remoteMessagingClient?.startRefreshingRemoteMessages()

if didCrashDuringCrashHandlersSetUp {
PixelKit.fire(GeneralPixel.crashOnCrashHandlersSetUp)
didCrashDuringCrashHandlersSetUp = false
}
}

private func fireFailedCompilationsPixelIfNeeded() {
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
targets: ["DataBrokerProtection"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.1-1"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.1-2"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../XPCHelper"),
],
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.1-1"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.1-2"),
.package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"),
.package(path: "../AppLauncher"),
.package(path: "../UDSHelper"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SubscriptionUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
targets: ["SubscriptionUI"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.1-1"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.1-2"),
.package(path: "../SwiftUIExtensions")
],
targets: [
Expand Down

0 comments on commit 161d8d2

Please sign in to comment.