Bug 45849 - WKURLCreateWithCFURL crashes with bad url
Summary: WKURLCreateWithCFURL crashes with bad url
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-15 16:39 PDT by Simon Fraser (smfr)
Modified: 2010-09-15 16:51 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 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.
Comment 1 Simon Fraser (smfr) 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);
Comment 2 Simon Fraser (smfr) 2010-09-15 16:51:49 PDT
http://trac.webkit.org/changeset/67580