mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user