Closed
Bug 667087
Opened 12 years ago
Closed 12 years ago
Cookies cannot be stored with single character hostnames
Categories
(Core :: Networking: Cookies, defect)
Tracking
()
VERIFIED
FIXED
Tracking | Status | |
---|---|---|
firefox5 | --- | unaffected |
blocking1.9.2 | --- | .20+ |
status1.9.2 | --- | .20-fixed |
People
(Reporter: chrisccoulson, Assigned: ehsan.akhgari)
References
Details
(Keywords: regression, reproducible, verified1.9.2)
Attachments
(2 files)
3.06 KB,
patch
|
dwitte
:
review+
christian
:
approval1.9.2.20+
|
Details | Diff | Splinter Review |
921 bytes,
patch
|
dwitte
:
review+
|
Details | Diff | Splinter Review |
I'm reporting this from https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/801778 Since Firefox 3.6.18, cookies cannot be stored with single character hostnames. This is reproducible by installing the extension developer addon and doing this in the JS shell: cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2); expiry = (Date.now() + 1000) * 1000; cm.countCookiesFromHost("a"); /* Should be 0 */ cm.add("a", "/", "foo", "bar", false, false, true, expiry); cm.countCookiesFromHost("a"); /* Is still 0, but should now be 1 */ This wasn't a problem in 3.6.17. It doesn't seem to be a problem on current nightlies or aurora either (I didn't test 5.0) I see there's a couple of suspect commits between 3.6.17 and 3.6.18, but I'm still waiting for my mozilla-1.9.2 tree to build before I can actually verify that: http://hg.mozilla.org/releases/mozilla-1.9.2/rev/bb935ffe5ff1 http://hg.mozilla.org/releases/mozilla-1.9.2/rev/bb728fdcd717
Reporter | ||
Updated•12 years ago
|
Updated•12 years ago
|
Reporter | ||
Comment 1•12 years ago
|
||
It's definitely this one which breaks it: http://hg.mozilla.org/releases/mozilla-1.9.2/rev/bb935ffe5ff1 When running the first iteration of the loop in nsCookieService::CountCookiesFromHostInt, (nextDot <= end && *(nextDot + 1) == '\0') always evaluates to true, so it just bails out
Updated•12 years ago
|
Blocks: 650522
Keywords: regression,
reproducible
Updated•12 years ago
|
blocking1.9.2: --- → ?
Hardware: x86_64 → All
Reporter | ||
Comment 2•12 years ago
|
||
Here is a patch which fixes this, with test-case. I'm not sure if it's the best way to fix this without understanding what http://hg.mozilla.org/releases/mozilla-1.9.2/rev/bb728fdcd717 is for.
Reporter | ||
Comment 3•12 years ago
|
||
Reporter | ||
Updated•12 years ago
|
Attachment #542125 -
Flags: review?(dwitte)
Reporter | ||
Updated•12 years ago
|
Attachment #542128 -
Flags: review?(dwitte)
Comment 4•12 years ago
|
||
apparently not a problem on trunk, where we took a different patch for bug 616264
Assignee: nobody → ehsan
blocking1.9.2: ? → .19+
status1.9.2:
--- → wanted
status-firefox5:
--- → unaffected
Assignee | ||
Updated•12 years ago
|
Comment 5•12 years ago
|
||
Comment on attachment 542125 [details] [diff] [review] Fix bug 667087.patch Looks great to me. Nice fix! r=dwitte
Attachment #542125 -
Flags: review?(dwitte) → review+
Comment 6•12 years ago
|
||
Comment on attachment 542128 [details] [diff] [review] Test for mozilla-central r=dwitte
Attachment #542128 -
Flags: review?(dwitte) → review+
Assignee | ||
Updated•12 years ago
|
Attachment #542125 -
Flags: approval1.9.2.19?
Assignee | ||
Comment 7•12 years ago
|
||
The ubuntu folks want this badly. Can we get the approval on this one soon, please?
Assignee | ||
Comment 8•12 years ago
|
||
I landed the m-c test on inbound. Please do not mark the bug as FIXED when you merge to central.
Whiteboard: DO NOT MARK AS FIXED WHEN MERGING TO CENTRAL
Comment on attachment 542125 [details] [diff] [review] Fix bug 667087.patch Approved for 1.9.2.19
Attachment #542125 -
Flags: approval1.9.2.19? → approval1.9.2.19+
Comment 10•12 years ago
|
||
test merged http://hg.mozilla.org/mozilla-central/rev/beadf61d53a7
Assignee | ||
Comment 11•12 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/2b1eb891d7fe
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: DO NOT MARK AS FIXED WHEN MERGING TO CENTRAL
Comment 13•12 years ago
|
||
(In reply to comment #12) > Verified fixed using 1.9.2 testcase for 1.9.2.20. Changing the resolution to verified.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•