From nobody Thu Oct 30 16:40:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500921784743973.9106035094402; Mon, 24 Jul 2017 11:43:04 -0700 (PDT) Received: from localhost ([::1]:56387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZiJp-0003cQ-1s for importer@patchew.org; Mon, 24 Jul 2017 14:43:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZi6k-00015l-Nm for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZi6i-0005fL-BZ for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:29:30 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:34356) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZi6i-0005f6-6o; Mon, 24 Jul 2017 14:29:28 -0400 Received: by mail-qk0-x241.google.com with SMTP id q66so10664119qki.1; Mon, 24 Jul 2017 11:29:28 -0700 (PDT) Received: from yoga.offpageads.com ([138.117.48.223]) by smtp.gmail.com with ESMTPSA id t57sm9033799qtt.18.2017.07.24.11.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 11:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K2EV1ph+x6Th5Q8AnH30/ZlAelSrWZ4P64n3I0W12cc=; b=FekGyQtLYl8qxAkMTkk80Xm+jjzJGFUCemVDtuTFEMQgDFZpaGHbBm5y5ITi64tfMS dvTydf2374W7+4kPs+iQKSI6GBHNj0xMuInneNO/CvSmFJOz7sPtE9CwJjGncDrJu8i3 5+hPdHa12Cwbnm/WokAcgCOBHPQPWF82coZXPcDR+vMi0sbAzHGuLXbQdUd4JWD7oGTs BQ+LiEa4RgySuEIEQog5rcsU5Kq+ldh05oeZXJhO+XA1UlUQYmz2tcCMGvZuNFgk3Ayv 7jOWH74MQRakqcBW0tR6gKJI27fgQ7xjflHcGain08O0gAv3n4q6BJWUi3+6FZMyO5ar Jzqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K2EV1ph+x6Th5Q8AnH30/ZlAelSrWZ4P64n3I0W12cc=; b=EfFe+OBvkTuQMoNPQDeS6yjUVEGcM9QbaWFO9u4wXMNbmdEJKhtheaTPbmZO3eZt7U dpUmWevbjxch/iwzbr2uEHbilj6falqX/duZH4XFbKr6S752lVc0A4ymCOGGgoZYPA/9 7FjqnaJsOKhCJm2KsvDSLYSSJTva0YJ0rFivYMuRzn2Css9io6QRtOn8ERZaVnttgydH C3PE/Xv4Rss1yYvcbKZMQnfKy1Q0+HSY5G+NciSQMBHRkjEKgQQX11A/nb1lH0MpIKAb Oa4ezPqToKHRauRimuxWbSvCfpqTVZJBAOTpO7MJlTr+30zM7BCOGmoyoZhP34IKA7t4 SJWA== X-Gm-Message-State: AIVw113UsIhzssGV1xnpfs/IWhXCfci9713BdLWG8Ge6Yg/MwfYLT3En 57ehTfO1R7ei8A== X-Received: by 10.55.33.77 with SMTP id h74mr22983735qkh.353.1500920967749; Mon, 24 Jul 2017 11:29:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Riku Voipio , Laurent Vivier Date: Mon, 24 Jul 2017 15:27:43 -0300 Message-Id: <20170724182751.18261-28-f4bug@amsat.org> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170724182751.18261-1-f4bug@amsat.org> References: <20170724182751.18261-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH for 2.10 27/35] syscall: fix dereference of undefined pointer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Clang's scan-build-5.0 reports: linux-user/syscall.c:5581:9: warning: Dereference of undefined pointer value if (*host_rt_dev_ptr !=3D 0) { ^~~~~~~~~~~~~~~~ Reported-by: Clang Static Analyzer Suggested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index fcd20fa276..e79b5baec4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5524,7 +5524,7 @@ static abi_long do_ioctl_rt(const IOCTLEntry *ie, uin= t8_t *buf_temp, int target_size; void *argptr; abi_ulong *target_rt_dev_ptr; - unsigned long *host_rt_dev_ptr; + unsigned long *host_rt_dev_ptr =3D NULL; abi_long ret; int i; =20 @@ -5570,6 +5570,7 @@ static abi_long do_ioctl_rt(const IOCTLEntry *ie, uin= t8_t *buf_temp, unlock_user(argptr, arg, 0); =20 ret =3D get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp)); + assert(host_rt_dev_ptr); if (*host_rt_dev_ptr !=3D 0) { unlock_user((void *)*host_rt_dev_ptr, *target_rt_dev_ptr, 0); --=20 2.13.3