Closed Bug 501725 Opened 15 years ago Closed 15 years ago

HTML5 parser uses nsDependentString() on strings that are not null terminated.

Categories

(Core :: DOM: HTML Parser, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jst, Unassigned)

Details

Attachments

(1 file)

I see a ton of these whenever I'm loading pages with the HTML5 parser enabled.

###!!! ASSERTION: nsTDependentString must wrap only null-terminated strings: 'mData[mLength] == 0', file ../../dist/include/nsTDependentString.h, line 67

Patch coming up.
Attachment #386303 - Flags: superreview?(mrbkap)
Attachment #386303 - Flags: review?(mrbkap)
Attachment #386303 - Flags: superreview?(mrbkap)
Attachment #386303 - Flags: superreview+
Attachment #386303 - Flags: review?(mrbkap)
Attachment #386303 - Flags: review+
Comment on attachment 386303 [details] [diff] [review]
Use nsDependentSubstring() instead.

>+  return local->Equals(nsDependentSubstring(buf + offset, buf + offset + length));
Isn't Substring preferred over explict uses of nsDependentSubstring?
Fixed.

http://hg.mozilla.org/mozilla-central/rev/bd42b12e6d2e
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
(In reply to comment #1)
> (From update of attachment 386303 [details] [diff] [review])
> >+  return local->Equals(nsDependentSubstring(buf + offset, buf + offset + length));
> Isn't Substring preferred over explict uses of nsDependentSubstring?

Duh, totally overlooked this comment here. And I don't know if Substring is preferred here, if it is I'm happy to change it, but this file uses nsDependentSubstring() elsewhere too.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: