xml: Fixed CDATA parsing.

Fixes #128.

R=r, rsc
https://golang.org/cl/154126
This commit is contained in:
Abhinav Gupta 2009-11-14 11:46:09 -08:00 committed by Russ Cox
parent 14a4ece979
commit bad9738be6
2 changed files with 9 additions and 5 deletions

View file

@ -497,11 +497,11 @@ func (p *Parser) RawToken() (Token, os.Error) {
case '[': // <![
// Probably <![CDATA[.
for i := 0; i < 7; i++ {
for i := 0; i < 6; i++ {
if b, ok = p.getc(); !ok {
return nil, p.err
}
if b != "[CDATA["[i] {
if b != "CDATA["[i] {
p.err = SyntaxError("invalid <![ sequence");
return nil, p.err;
}