Last Comment Bug 666706 - Don't pass IPv6 literals to the effective TLD service, since the brackets prevent them from being recognized as IPs
: Don't pass IPv6 literals to the effective TLD service, since the brackets pre...
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Location Bar (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 7
Assigned To: Dão Gottwald [:dao]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-23 12:14 PDT by Dão Gottwald [:dao]
Modified: 2011-06-26 06:17 PDT (History)
2 users (show)
dao+bmo: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
tests (3.12 KB, patch)
2011-06-23 12:14 PDT, Dão Gottwald [:dao]
no flags Details | Diff | Splinter Review
patch (3.75 KB, patch)
2011-06-23 22:14 PDT, Dão Gottwald [:dao]
gavin.sharp: review+
Details | Diff | Splinter Review

Description Dão Gottwald [:dao] 2011-06-23 12:14:24 PDT
Created attachment 541454 [details] [diff] [review]
tests

I generated the attached tests based on <http://hg.mozilla.org/mozilla-central/rev/8b5646a07963>. The eTLD service fails for every host containing a dot, e.g. [::192.168.1.1], for which it considers "1.1]" to be the base domain.
Comment 1 Dão Gottwald [:dao] 2011-06-23 12:18:55 PDT
Or maybe the problem is that I'm passing the host with the brackets to getBaseDomainFromHost?
Comment 2 Dão Gottwald [:dao] 2011-06-23 22:14:34 PDT
Created attachment 541604 [details] [diff] [review]
patch
Comment 3 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-06-23 22:26:26 PDT
There's PR_StringToNetAddr logic in nsEffectiveTLDService::GetBaseDomainInternal that I would assume should be catching this. Does it just not handle the bracket format? I'm not very familiar with ipv6 IP address formats.
Comment 4 Shawn Wilsher :sdwilsh 2011-06-23 22:34:31 PDT
(In reply to comment #3)
> There's PR_StringToNetAddr logic in
> nsEffectiveTLDService::GetBaseDomainInternal that I would assume should be
> catching this. Does it just not handle the bracket format? I'm not very
> familiar with ipv6 IP address formats.
IIRC it doesn't handle that format.
Comment 5 Dão Gottwald [:dao] 2011-06-23 23:46:34 PDT
Passing them without the brackets to getBaseDomainFromHost works, but removing the brackets in order to do that would be pointless, as getBaseDomainFromHost would just throw anyway.
Comment 6 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-06-24 14:12:39 PDT
getBaseDomainFromHost should probably also throw when the brackets are included, rather than returning a bogus result.
Comment 7 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-06-24 14:19:52 PDT
Comment on attachment 541604 [details] [diff] [review]
patch

can you file a followup for that and add a comment?
Comment 8 Dão Gottwald [:dao] 2011-06-25 02:17:51 PDT
http://hg.mozilla.org/mozilla-central/rev/a8b1330b8ac9

filed bug 667159

Note You need to log in before you can comment on or make changes to this bug.