aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2019-10-21 13:48:49 +0200
committerLaurent Vivier <laurent@vivier.eu>2019-10-21 15:22:37 +0200
commit8f93089d0a3cde294e8bb16978a3f7fd0b2df2a3 (patch)
tree758f1d7e058ef9ee39ae0e8f1f94c2b0d34f9440 /linux-user
parent1645fb5a1e537f85eda744bfa6e9d3dda047ba28 (diff)
linux-user/strace: Display invalid pointer in print_timeval()
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>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/strace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux-user/strace.c b/linux-user/strace.c
index c80e93b5db..f326c357a2 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -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);