Skip to content

Commit

Permalink
linux-user/strace: Display invalid pointer in print_timeval()
Browse files Browse the repository at this point in the history
Suggested-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20191021114857.20538-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
philmd authored and vivier committed Oct 21, 2019
1 parent 1645fb5 commit 8f93089
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion linux-user/strace.c
Expand Up @@ -1243,8 +1243,10 @@ print_timeval(abi_ulong tv_addr, int last)
struct target_timeval *tv;

tv = lock_user(VERIFY_READ, tv_addr, sizeof(*tv), 1);
if (!tv)
if (!tv) {
print_pointer(tv_addr, last);
return;
}
gemu_log("{" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "}%s",
tswapal(tv->tv_sec), tswapal(tv->tv_usec), get_comma(last));
unlock_user(tv, tv_addr, 0);
Expand Down

0 comments on commit 8f93089

Please sign in to comment.