Strace: handle null paths

PiperOrigin-RevId: 382603592
This commit is contained in:
Fabricio Voznika
2021-07-01 14:23:01 -07:00
committed by gVisor bot
parent 590b8d3e99
commit 3d4a8824f8
+3
View File
@@ -133,6 +133,9 @@ func dump(t *kernel.Task, addr hostarch.Addr, size uint, maximumBlobSize uint) s
}
func path(t *kernel.Task, addr hostarch.Addr) string {
if addr == 0 {
return "<null>"
}
path, err := t.CopyInString(addr, linux.PATH_MAX)
if err != nil {
return fmt.Sprintf("%#x (error decoding path: %s)", addr, err)