From 9dd92e124738bea45d60514e3aa597d7f999d907 Mon Sep 17 00:00:00 2001 From: Egor Kovetskiy Date: Fri, 10 Apr 2015 15:30:57 +0600 Subject: [PATCH] fix eternal cycle with malicious xml packet --- xmpp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmpp.go b/xmpp.go index 889b68b..28991f2 100644 --- a/xmpp.go +++ b/xmpp.go @@ -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) {