Bug 12385 - Assertion failure when loading subresources from "data:" frames
Summary: Assertion failure when loading subresources from "data:" frames
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
: 10431 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-23 11:53 PST by Alexey Proskuryakov
Modified: 2007-01-26 10:29 PST (History)
2 users (show)

See Also:


Attachments
proposed fix (4.02 KB, patch)
2007-01-23 11:58 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
proposed fix (5.56 KB, patch)
2007-01-25 12:34 PST, Alexey Proskuryakov
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2007-01-23 11:53:44 PST
copyPathRemovingDots() in KURL.cpp is unprepared to deal with URLs that don't start with a slash, but KURL::init() may pass non-hierarchical base URLs to it.
Comment 1 Alexey Proskuryakov 2007-01-23 11:58:46 PST
Created attachment 12633 [details]
proposed fix
Comment 2 mitz 2007-01-23 12:04:53 PST
*** Bug 10431 has been marked as a duplicate of this bug. ***
Comment 3 Maciej Stachowiak 2007-01-23 14:41:35 PST
Maybe the right thing to do for non-hierarchical URLs is to append the relative URL to the scheme instead of the whole URL. Appending to a javascript: URL in particular could have weird consequences and is likely not desired. What do other browsrs do in such cases?
Comment 4 Alexey Proskuryakov 2007-01-24 11:05:59 PST
Comment on attachment 12633 [details]
proposed fix

It looks like Firefox just renders the URL invalid in such case, and doesn't try to load from it. Maybe this is what we should do for invalid base URLs, too?

A more thorough test has uncovered another related issue which I'm going to investigate now - javascript URLs shouldn't be treated as relative.
Comment 5 Alexey Proskuryakov 2007-01-25 12:34:27 PST
Created attachment 12670 [details]
proposed fix

So, it looks like such URLs are treated as invalid by Firefox.

Please note that the code for invalid base URLs was only executed for empty ones, because non-empty invalid base URLs were dealt with at the beginning of KURL::init().

There are still some issues with handling "javascript:" URLs (see comments in the test case), but those are outside KURL, and have bugs of their own filed.
Comment 6 Maciej Stachowiak 2007-01-25 22:21:13 PST
Comment on attachment 12670 [details]
proposed fix

r=me
Comment 7 Alexey Proskuryakov 2007-01-26 10:29:36 PST
Committed revision 19159.