From nobody Mon Feb 9 20:36:05 2026 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; 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 15014970924098.931827425517099; Mon, 31 Jul 2017 03:31:32 -0700 (PDT) Received: from localhost ([::1]:58612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dc7z1-0002nH-40 for importer@patchew.org; Mon, 31 Jul 2017 06:31:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dc7ur-0007q5-2H for qemu-devel@nongnu.org; Mon, 31 Jul 2017 06:27:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dc7uo-0001zl-Gz for qemu-devel@nongnu.org; Mon, 31 Jul 2017 06:27:13 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:40697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dc7uo-0001yo-8f; Mon, 31 Jul 2017 06:27:10 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8A0C742ABE; Mon, 31 Jul 2017 13:27:09 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id B74CFB87; Mon, 31 Jul 2017 13:21:45 +0300 (MSK) Received: (nullmailer pid 5571 invoked by uid 1000); Mon, 31 Jul 2017 10:21:45 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Mon, 31 Jul 2017 13:21:35 +0300 Message-Id: <6860710cc3864382a898c847d722f950b5e01a6e.1501496349.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 16/25] syscall: fix use of uninitialized values 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, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 linux-user/syscall.c:1627:35: warning: 1st function call argument is an uni= nitialized value target_saddr->sa_family =3D tswap16(addr->sa_family); ^~~~~~~~~~~~~~~~~~~~~~~~ linux-user/syscall.c:1629:25: warning: The left operand of '=3D=3D' is a ga= rbage value if (addr->sa_family =3D=3D AF_NETLINK && len >=3D sizeof(struct sockadd= r_nl)) { ~~~~~~~~~~~~~~~ ^ Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Signed-off-by: Michael Tokarev --- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 71d45a9963..81f52f7483 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1622,6 +1622,7 @@ static inline abi_long host_to_target_sockaddr(abi_ul= ong target_addr, if (len =3D=3D 0) { return 0; } + assert(addr); =20 target_saddr =3D lock_user(VERIFY_WRITE, target_addr, len, 0); if (!target_saddr) --=20 2.11.0