[Qemu-devel] [PATCH v5 02/10] linux-user/strace: Display invalid pointer in print_timeval()

Philippe Mathieu-Daudé posted 10 patches 7 years ago
Only 8 patches received!
There is a newer version of this series
[Qemu-devel] [PATCH v5 02/10] linux-user/strace: Display invalid pointer in print_timeval()
Posted by Philippe Mathieu-Daudé 7 years ago
Suggested-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 linux-user/strace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 33f4a506a2..c95557bf83 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1173,8 +1173,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);
-- 
2.19.1