Add missing error handling.

This commit is contained in:
Martin Dosch 2024-01-08 19:32:08 +01:00
parent 6c9243326e
commit 3462085098

View File

@ -535,6 +535,9 @@ func (c *Client) init(o *Options) error {
}
case strings.HasPrefix(serverReply, "s="):
salt, err = base64.StdEncoding.DecodeString(strings.SplitN(serverReply, "=", 2)[1])
if err != nil {
return err
}
if string(salt) == "" {
return errors.New("SCRAM: server sent empty salt")
}