Message ID | ba4b3f668abf1fcde204c8f3185ea6edeec6eaa3.1470319929.git.riku.voipio@linaro.org |
---|---|
State | Accepted |
Commit | ba4b3f668abf1fcde204c8f3185ea6edeec6eaa3 |
Headers | show |
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ca6a2b4..092ff4e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6856,7 +6856,7 @@ static int open_self_cmdline(void *cpu_env, int fd) if (!word_skipped) { /* Skip the first string, which is the path to qemu-*-static instead of the actual command. */ - cp_buf = memchr(buf, 0, sizeof(buf)); + cp_buf = memchr(buf, 0, nb_read); if (cp_buf) { /* Null byte found, skip one string */ cp_buf++;