[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
Tue Jun 7 10:44:26 PDT 2011


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





--- Comment #10 from Jeffrey Pfau <jeffrey at endrift.com>  2011-06-07 10:44:26 PST ---
In the XML spec, null characters are disallowed. (In the 1.0 spec it is not shown in the permissible character range, and in 1.1 it is explicitly stated that it is disallowed.) However, this doesn't mean we should strip out the null characters; they're still there in the string that's being parsed. But we also shouldn't ignore them or treat them as an artificial string terminator, and given that they're disallowed in XML, we shouldn't just replace them either.

My proposed solution is to pass the length of the string along with the string that potentially has nulls in it. libxml2 keeps parsing until it hits the first NULL (even though you pass the length of the string in), at which point it returns that it processed however many characters there are until the null character. Since we know the expected number of bytes to be processed, we can tell if it stopped midway through the string and throw an error if so; we should always process the full string as it is, and there is already an ASSERT to that effect.

-- 
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