File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
credentials/alts/internal/conn Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -166,12 +166,7 @@ func (p *conn) Read(b []byte) (n int, err error) {
166
166
panic (fmt .Sprintf ("protected buffer length shorter than expected: %d vs %d" , len (p .protected ), MsgLenFieldSize ))
167
167
}
168
168
oldProtectedBuf := p .protected
169
- // The new buffer must be able to hold the message length header
170
- // and the entire message.
171
- requiredCapacity := int (length ) + MsgLenFieldSize
172
- p .protected = make ([]byte , requiredCapacity )
173
- // Copy the contents of the old buffer and set the length of the
174
- // new buffer to the number of bytes already read.
169
+ p .protected = make ([]byte , int (length )+ MsgLenFieldSize )
175
170
copy (p .protected , oldProtectedBuf )
176
171
p .protected = p .protected [:len (oldProtectedBuf )]
177
172
}
You can’t perform that action at this time.
0 commit comments