From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAN6K-0002dh-Li for qemu-devel@nongnu.org; Wed, 10 Oct 2018 18:37:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAN6H-0000J9-TI for qemu-devel@nongnu.org; Wed, 10 Oct 2018 18:37:08 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:36302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAN6G-0000I4-KB for qemu-devel@nongnu.org; Wed, 10 Oct 2018 18:37:05 -0400 Received: by mail-wm1-x32e.google.com with SMTP id a8-v6so7318473wmf.1 for ; Wed, 10 Oct 2018 15:37:04 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 11 Oct 2018 00:36:48 +0200 Message-Id: <20181010223656.31632-3-f4bug@amsat.org> In-Reply-To: <20181010223656.31632-1-f4bug@amsat.org> References: <20181010223656.31632-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v5 02/10] linux-user/strace: Display invalid pointer in print_timeval() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Riku Voipio , =?UTF-8?q?Guido=20G=C3=BCnther?= Suggested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- 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