Limit the lisafs buffer that are printed with strace.

Otherwise, in case case read request asks for a lot of bytes but
response contains fewer bytes, we end up printing a lot of
garbage.

PiperOrigin-RevId: 458140547
This commit is contained in:
Ayush Ranjan
2022-06-29 22:40:37 -07:00
committed by gVisor bot
parent 8a95700ffe
commit 0c3abacb1c
+2 -1
View File
@@ -880,7 +880,8 @@ func (r *PReadResp) CheckedUnmarshal(src []byte) ([]byte, bool) {
// We expect the client to have already allocated r.Buf. r.Buf probably
// (optimally) points to usermem. Directly copy into that.
return srcRemain[copy(r.Buf[:r.NumBytes], srcRemain[:r.NumBytes]):], true
r.Buf = r.Buf[:r.NumBytes]
return srcRemain[copy(r.Buf, srcRemain[:r.NumBytes]):], true
}
// PWriteReq is used to pwrite(2) on an FD.