Closed Bug 200437 Opened 22 years ago Closed 22 years ago

fix assertion in GetCookie()

Categories

(Core :: Networking: Cookies, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: dwitte, Assigned: dwitte)

Details

Attachments

(1 file, 1 obsolete file)

this one was introduced ages ago, at some point after the cookie string rewrite. CharAt is asserting if you try to read off the end of the string, so we just need to shift that call to after the length check. it looked ugly so i refactored into a helper function, consistent with the parser stuff, to look nicer. thanks to mvl for spotting these assertions :)
Attached patch fix (obsolete) — Splinter Review
Attachment #119268 - Flags: superreview?(darin)
Attachment #119268 - Flags: review?(mvl)
Comment on attachment 119268 [details] [diff] [review] fix sr=darin
Attachment #119268 - Flags: superreview?(darin) → superreview+
Attachment #119268 - Flags: review?(mvl) → review+
Attached patch fix 2Splinter Review
now with updated comment, per mvl's request.
Attachment #119268 - Attachment is obsolete: true
Comment on attachment 119274 [details] [diff] [review] fix 2 carrying over r/sr.
Attachment #119274 - Flags: superreview+
Attachment #119274 - Flags: review+
fixed-on-trunk @ 0117 by Neil. thanks!
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
If someone has a simple case w/ some output that shows an assertion happening (then going away post-fix), if you could paste that in here and VERIFIED/FIXED, that would be great.
Keywords: verifyme
QA Contact: cookieqa → ashishbhatt
Without that patch, I see the assertions while running dwitte's TestCookie.cpp. ###!!! ASSERTION: |CharAt| out-of-range: 'i<Length()', file ../../dist/include/string/nsASingleFragmentString.h, line 197 Break: at file ../../dist/include/string/nsASingleFragmentString.h, line 197 With a current cvs trunk build, I don't see the assertions while running the same file. (nothing to paste here :) )
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: