Explorar o código

fix length check in auth reader

Darien Raymond %!s(int64=8) %!d(string=hai) anos
pai
achega
5c9f54a453
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      common/crypto/auth.go

+ 2 - 2
common/crypto/auth.go

@@ -162,7 +162,7 @@ func (r *AuthenticationReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
 		mb.Write(b)
 	} else {
 		var bb *buf.Buffer
-		if len(b) < buf.Size {
+		if len(b) <= buf.Size {
 			bb = buf.New()
 		} else {
 			bb = buf.NewLocal(len(b))
@@ -180,7 +180,7 @@ func (r *AuthenticationReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
 			mb.Write(b)
 		} else {
 			var bb *buf.Buffer
-			if len(b) < buf.Size {
+			if len(b) <= buf.Size {
 				bb = buf.New()
 			} else {
 				bb = buf.NewLocal(len(b))