Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/xml: CharData returned is slice of internal buffer, so it gets overwritten #673
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.