diff options
Diffstat (limited to 'executor/executor.cc')
| -rw-r--r-- | executor/executor.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index e48c26008..56115f909 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -586,15 +586,17 @@ void execute_call(thread_t* th) debug("open(\"%s\", 0x%lx)\n", buf, flags); th->res = open(buf, flags, 0); } else { + // syz_open_dev(dev strconst, id intptr, flags flags[open_flags]) fd uint64_t id = th->args[1]; uint64_t flags = th->args[2]; char buf[128]; strncpy(buf, dev, sizeof(buf)); buf[sizeof(buf) - 1] = 0; - char* hash = strchr(buf, '#'); - if (hash != NULL) + while (char* hash = strchr(buf, '#')) { *hash = '0' + (char)(id % 10); // 10 devices should be enough for everyone. + id /= 10; + } debug("syz_open_dev(\"%s\", 0x%lx, 0)\n", buf, flags); th->res = open(buf, flags, 0); } |
