mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 04:23:45 -07:00
Add missing error handling.
This commit is contained in:
@@ -535,6 +535,9 @@ func (c *Client) init(o *Options) error {
|
|||||||
}
|
}
|
||||||
case strings.HasPrefix(serverReply, "s="):
|
case strings.HasPrefix(serverReply, "s="):
|
||||||
salt, err = base64.StdEncoding.DecodeString(strings.SplitN(serverReply, "=", 2)[1])
|
salt, err = base64.StdEncoding.DecodeString(strings.SplitN(serverReply, "=", 2)[1])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if string(salt) == "" {
|
if string(salt) == "" {
|
||||||
return errors.New("SCRAM: server sent empty salt")
|
return errors.New("SCRAM: server sent empty salt")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user