You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I managed to trigger the bug in a non-trivial bit of xml parsing I was
doing. Apologies that I don't have a test case, but the result of the
CharData for
<TagName>Data Inside of Tag</TagName>
was
"TagNameide of Tag".
That is, it seemed like other parsing had overwritten the CharData.
Looking at the code, it seems that a slice from p.buf is being returned
directly in xml.Parser.text(). When I changed xml.Parser.RawToken to
return CharData(data).Copy() instead of just CharData(data), the issue went
away.
What is your $GOOS? $GOARCH?
darwin 386
Which revision are you using? (hg identify)
5f7ba03638b5+ tip
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
Nevermind, this bug is invalid. I didn't see that the documentation notes that tokens
are
only valid until the next call to "Token()".
Sorry about that.
mikioh
changed the title
XML CharData returned is slice of internal buffer, so it gets overwritten
encoding/xml: CharData returned is slice of internal buffer, so it gets overwritten
Jan 9, 2015
by consalus:
The text was updated successfully, but these errors were encountered: