diff --git a/common/crypto/auth.go b/common/crypto/auth.go index 65bba5e26c3..f8ba55b8dce 100644 --- a/common/crypto/auth.go +++ b/common/crypto/auth.go @@ -178,7 +178,7 @@ func (r *AuthenticationReader) readInternal(soft bool, mb *buf.MultiBuffer) erro return errSoft } - if size <= buf.Size { + if effectiveSize <= buf.Size { b, err := r.readBuffer(effectiveSize, int32(padding)) if err != nil { return err