aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-01-08 15:30:38 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-01-09 20:20:49 +0100
commitbdc6d550b0c49d0b131872fb71f1f40288a10147 (patch)
treef74546a022c28b67039f00d61284c25f0f6b59ff /executor
parentc5f38186d296b1e4ce59cb51889bce481cce266d (diff)
executor: use NONFAILING strcpy in syz_open_dev
The source is fuzzer provided memory, it can be non-addressable.
Diffstat (limited to 'executor')
-rw-r--r--executor/common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common.h b/executor/common.h
index 34601df0f..3b6b27297 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -281,7 +281,7 @@ static uintptr_t syz_open_dev(uintptr_t a0, uintptr_t a1, uintptr_t a2)
// syz_open_dev(dev strconst, id intptr, flags flags[open_flags]) fd
char buf[1024];
char* hash;
- strncpy(buf, (char*)a0, sizeof(buf));
+ NONFAILING(strncpy(buf, (char*)a0, sizeof(buf)));
buf[sizeof(buf) - 1] = 0;
while ((hash = strchr(buf, '#'))) {
*hash = '0' + (char)(a1 % 10); // 10 devices should be enough for everyone.