Bug 45849

Summary: WKURLCreateWithCFURL crashes with bad url
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   

Simon Fraser (smfr)
Reported 2010-09-15 16:39:42 PDT
I entered a bogus url into MiniBrowser's url bar, and hit return, and it crashed. URL was <rdar://problem/999> Crashes in WKURLCreateWithCFURL at: String urlString(CFURLGetString(cfURL)); cfURL is null.
Attachments
Simon Fraser (smfr)
Comment 1 2010-09-15 16:42:53 PDT
Minibrowser bug I guess: diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m index 43351e5..162d99a 100644 --- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m +++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m @@ -61,6 +61,9 @@ - (void)dealloc - (IBAction)fetch:(id)sender { CFURLRef cfURL = CFURLCreateWithString(0, (CFStringRef)[urlText stringValue], 0); + if (!cfURL) + return; + WKURLRef url = WKURLCreateWithCFURL(cfURL); CFRelease(cfURL);
Simon Fraser (smfr)
Comment 2 2010-09-15 16:51:49 PDT
Note You need to log in before you can comment on or make changes to this bug.