forked from jshiffer/go-xmpp
Merge pull request #51 from kovetskiy/master
fix eternal cycle with malicious xml packet
This commit is contained in:
commit
cc56ae0810
2
xmpp.go
2
xmpp.go
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user