summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2021-07-01 14:20:16 -0700
committergVisor bot <gvisor-bot@google.com>2021-07-01 14:23:01 -0700
commit3d4a8824f8e7aafdf6c1d18822b7593fa2e3e6bb (patch)
tree6c131a8dcd86bf442e3c7c764c1090c91577d23a
parent590b8d3e99dd24d2bb625d00fa99fbc9296dfe2b (diff)
Strace: handle null paths
PiperOrigin-RevId: 382603592
-rw-r--r--pkg/sentry/strace/strace.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/strace/strace.go b/pkg/sentry/strace/strace.go
index af7088847..3ea9c31dd 100644
--- a/pkg/sentry/strace/strace.go
+++ b/pkg/sentry/strace/strace.go
@@ -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)