Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapping an ad with an malformed/invalid target URL crashes the app #2564

Closed
kylehickinson opened this issue May 21, 2020 · 0 comments
Closed

Tapping an ad with an malformed/invalid target URL crashes the app #2564

kylehickinson opened this issue May 21, 2020 · 0 comments

Comments

@kylehickinson
Copy link
Contributor

@kylehickinson kylehickinson commented May 21, 2020

Description:

Sometimes an ad URL in the catalog may be invalid/malformed in some way that creates a nil NSURL which will cause a crash when bridged to Swift as it expects a non-nil value.

Crash Log
Hardware Model:      iPad8,1
Process:             Client [15230]
Path:                /private/var/containers/Bundle/Application/1D48F961-BB46-4DD5-B76A-8CDD4E3DD683/Client.app/Client
Identifier:          com.brave.ios.browser
Version:             20.05.15.21 (1.16.2)
AppStoreTools:       11E608a
AppVariant:          1:iPad8,1:13
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.brave.ios.browser [1049]


Date/Time:           2020-05-21 06:11:38.2629 +0300
Launch Time:         2020-05-21 06:09:21.6244 +0300
OS Version:          iPhone OS 13.4.1 (17E262)
Release Type:        User
Baseband Version:    n/a
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001d145a898
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [15230]
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   libswiftFoundation.dylib      	0x00000001d145a898 static URL._unconditionallyBridgeFromObjectiveC(_:) + 184 (URL.swift:1171)
1   Client                        	0x0000000102653b9c closure #3 in BrowserViewController.didInit() + 248 (BrowserViewController.swift:263)
2   Client                        	0x0000000102653b9c closure #3 in BrowserViewController.didInit() + 248 (BrowserViewController.swift:263)
3   BraveRewardsUI                	0x000000010306d3e4 closure #2 in AdsNotificationHandler.displayAd(notification:) + 764 (AdsNotificationHandler.swift:78)
4   BraveRewardsUI                	0x00000001030610d8 AdsViewController.tappedAdView(_:) + 536 (AdsViewController.swift:154)
5   BraveRewardsUI                	0x0000000103061280 @objc AdsViewController.tappedAdView(_:) + 52 (<compiler-generated>:0)
6   UIKitCore                     	0x000000019ef354c4 -[UIApplication sendAction:to:from:forEvent:] + 100 (UIApplication.m:5299)
7   UIKitCore                     	0x000000019e91ffe8 -[UIControl sendAction:to:forEvent:] + 208 (UIControl.m:711)
8   UIKitCore                     	0x000000019e920350 -[UIControl _sendActionsForEvents:withEvent:] + 400 (UIControl.m:794)
9   UIKitCore                     	0x000000019e91f368 -[UIControl touchesEnded:withEvent:] + 520 (UIControl.m:542)
10  UIKitCore                     	0x000000019ef70878 -[UIWindow _sendTouchesForEvent:] + 1024 (UIWindow.m:2620)
11  UIKitCore                     	0x000000019ef72060 -[UIWindow sendEvent:] + 3548 (UIWindow.m:2896)
12  UIKitCore                     	0x000000019ef4d1cc -[UIApplication sendEvent:] + 348 (UIApplication.m:11349)
13  UIKitCore                     	0x000000019efcfe0c __dispatchPreprocessedEventFromEventQueue + 6328 (UIEventDispatcher.m:1877)
14  UIKitCore                     	0x000000019efd2a14 __handleEventQueueInternal + 5360 (UIEventDispatcher.m:2153)
15  UIKitCore                     	0x000000019efcac88 __handleHIDEventFetcherDrain + 144 (UIEventDispatcher.m:2214)
16  CoreFoundation                	0x000000019ad65860 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1922)
17  CoreFoundation                	0x000000019ad657b4 __CFRunLoopDoSource0 + 84 (CFRunLoop.c:1956)
18  CoreFoundation                	0x000000019ad64f04 __CFRunLoopDoSources0 + 196 (CFRunLoop.c:1992)
19  CoreFoundation                	0x000000019ad5fca4 __CFRunLoopRun + 796 (CFRunLoop.c:2882)
20  CoreFoundation                	0x000000019ad5f660 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
21  GraphicsServices              	0x00000001a5170604 GSEventRunModal + 164 (GSEvent.c:2246)
22  UIKitCore                     	0x000000019ef3415c UIApplicationMain + 1944 (UIApplication.m:4820)
23  Client                        	0x00000001023f7538 main + 232 (main.swift:15)
24  libdyld.dylib                 	0x000000019abdb1ec start + 4
@kylehickinson kylehickinson self-assigned this May 21, 2020
kylehickinson added a commit that referenced this issue May 21, 2020
@kylehickinson kylehickinson added this to the 1.17 milestone May 22, 2020
kylehickinson added a commit that referenced this issue May 22, 2020
kylehickinson added a commit that referenced this issue May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.