[Webkit-unassigned] [Bug 61053] Using NULL bytes when setting innerHTML in xhtml ASSERT and NULL ptr

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 19 09:51:17 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=61053





--- Comment #8 from Darin Adler <darin at apple.com>  2011-05-19 09:51:17 PST ---
(In reply to comment #6)
> It does seem like:
> CString String::utf8(bool strict) const
> Should replace nulls, since it returns a null terminated string.

That’s an interesting point.

Although constructing a CString does add a null terminator, the class will work with strings that have embedded nulls. The CString length function will still return the correct length that includes all the nulls and not the null terminator, and as long as we don’t use the data pointer as a null-terminated string we can make code that works with it just fine.

But since CString clients are highly likely to use it as a null-terminated string, this could lead to problems and maybe even security vulnerabilities so we may want to change the design of the CString class or the String::utf8 function.

We’ll have to decide if we want different behavior, and if so, implement it.

None of that is necessarily required to fix this bug. Once we decide what behavior we want we can almost certainly fix this problem in the XML parser code, without changing the current design and implementation of CString.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list