Merge pull request #51 from kovetskiy/master

fix eternal cycle with malicious xml packet
This commit is contained in:
mattn 2015-04-10 18:48:33 +09:00
commit cc56ae0810

View File

@ -685,7 +685,7 @@ type clientError struct {
func nextStart(p *xml.Decoder) (xml.StartElement, error) { func nextStart(p *xml.Decoder) (xml.StartElement, error) {
for { for {
t, err := p.Token() t, err := p.Token()
if err != nil && err != io.EOF { if err != nil && err != io.EOF || t == nil {
return xml.StartElement{}, err return xml.StartElement{}, err
} }
switch t := t.(type) { switch t := t.(type) {