diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-02-04 14:50:55 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-02-05 22:12:15 +0100 |
| commit | ba993a55b95a1cceced575b6583059fbb7735323 (patch) | |
| tree | ccc9e1518ebb8414276ca5900ab79d51506d5185 /host | |
| parent | 50147480de478e4bcef17f10a978a9da0871ac29 (diff) | |
sys: terminate string constants with \x00
C expects string constants to be zero terminated.
It worked to some degree probably because most memory is zeros in executor.
Diffstat (limited to 'host')
| -rw-r--r-- | host/host.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/host/host.go b/host/host.go index 942632f4c..86357e90f 100644 --- a/host/host.go +++ b/host/host.go @@ -82,7 +82,7 @@ func isSupportedSyzkall(kallsyms []byte, c *sys.Call) bool { } return false } - return check(fname.Val) + return check(fname.Val[:len(fname.Val)-1]) case "syz_open_pts": return true case "syz_fuse_mount": @@ -118,7 +118,7 @@ func isSupportedOpen(kallsyms []byte, c *sys.Call) bool { if !ok { return true } - fd, err := syscall.Open(fname.Val, syscall.O_RDONLY, 0) + fd, err := syscall.Open(fname.Val[:len(fname.Val)-1], syscall.O_RDONLY, 0) if fd != -1 { syscall.Close(fd) } |
