forked from jshiffer/go-xmpp
fix eternal cycle with malicious xml packet
This commit is contained in:
parent
8b13d0ad77
commit
9dd92e1247
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