Bug 166706 - A couple of input strings that crash URLParser
Summary: A couple of input strings that crash URLParser
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-04 17:14 PST by Keith Rollin
Modified: 2017-01-04 17:18 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2017-01-04 17:14:55 PST
I have some test code that includes the following:

TEST_F(URLTest, ProtocolHostAndPort)
{
    URL url1(ParsedURLString, "http://username:@www.example.com:8080/index.html?var=val#fragment");
    URL url2(ParsedURLString, "http://www.example.com:/index.html?var=val#fragment");
}

When trying to include either those objects in my tests, I get the following error:

$ ./run-api-tests URLTest
Running build-api-tests
UNEXPECTEDLY EXITED URLTest.ProtocolHostAndPort

I'm assuming that "UNEXPECTEDLY EXITED" means that something has crashed, and that the thing crashing is URLParser.
Comment 1 Alex Christensen 2017-01-04 17:18:32 PST
You're probably hitting this assertion:
ASSERT(url == m_string);

That's correct because the canonicalized URLs are not equal to the input strings.  Don't use ParsedURLString for strings that are not the output of a successfully parsed URL.