From ba993a55b95a1cceced575b6583059fbb7735323 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 4 Feb 2016 14:50:55 +0100 Subject: 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. --- host/host.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host') 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) } -- cgit mrf-deployment