fix eternal cycle with malicious xml packet

This commit is contained in:
Egor Kovetskiy 2015-04-10 15:30:57 +06:00
parent 8b13d0ad77
commit 9dd92e1247

View File

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