Bug 37777 - protocolHostAndPortEquals host check makes a wrong assumption
Summary: protocolHostAndPortEquals host check makes a wrong assumption
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Julien Chaffraix
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-18 15:01 PDT by Julien Chaffraix
Modified: 2010-04-24 09:47 PDT (History)
0 users

See Also:


Attachments
Proposed fix: take URLs credential into account (5.29 KB, patch)
2010-04-18 15:37 PDT, Julien Chaffraix
ap: review+
jchaffraix: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2010-04-18 15:01:09 PDT
The logic assumes that both the URL starts at the same position. This is right for most URL but is wrong for URL containing credentials: the code will return false for http://foo.example.com and http://user:pass@foo.example.com.
Comment 1 Julien Chaffraix 2010-04-18 15:37:52 PDT
Created attachment 53639 [details]
Proposed fix: take URLs credential into account
Comment 2 Alexey Proskuryakov 2010-04-19 23:13:33 PDT
Comment on attachment 53639 [details]
Proposed fix: take URLs credential into account

+    int lengthHostA = a.hostEnd() - hostStartA;

It's strange that the order of words is different in old and new variables, "host start" vs. "length host".

r=me, good catch!
Comment 3 Julien Chaffraix 2010-04-24 09:47:18 PDT
(In reply to comment #2)
> (From update of attachment 53639 [details])
> +    int lengthHostA = a.hostEnd() - hostStartA;
> 
> It's strange that the order of words is different in old and new variables,
> "host start" vs. "length host".

Landed in r58219 with this correction.