Closed
Bug 280386
Opened 20 years ago
Closed 20 years ago
Add sanity checking to nsScanner::SetPosition()
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: mrbkap, Assigned: mrbkap)
References
()
Details
Attachments
(1 file)
1.21 KB,
patch
|
bzbarsky
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
In the past month or so (especially after bryner's string changes), we've had a few bugs pop up because of incorrect use of nsScanner::SetPosition(). In general, these bugs are hard to catch (unless they trigger a crash) since the most noticeable side effect of the bad calls are that the mCountRemaining member variable becomes extremely large, leading to strange bugs (like bug 273085, where Peek() was returning NS_OK, while giving a garbage result because it relies on mCountRemaining). I've added an assertion to the function that should catch most (if not all) problems of this sort in an easier to spot place (when the bad call is made) as opposed to the problem showing up in a random way down the line.
Assignee | ||
Comment 1•20 years ago
|
||
Attachment #172848 -
Flags: superreview?(jst)
Attachment #172848 -
Flags: review?(bzbarsky)
Comment 2•20 years ago
|
||
Comment on attachment 172848 [details] [diff] [review] Add an assertion r=bzbarsky
Attachment #172848 -
Flags: review?(bzbarsky) → review+
Comment 3•20 years ago
|
||
Comment on attachment 172848 [details] [diff] [review] Add an assertion sr=jst
Attachment #172848 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 4•20 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•