From nobody Thu Oct 30 00:20:55 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 150092228057981.66250607227596; Mon, 24 Jul 2017 11:51:20 -0700 (PDT) Received: from localhost ([::1]:56446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZiRr-0002PX-7j for importer@patchew.org; Mon, 24 Jul 2017 14:51:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZi6t-0001FT-MM for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:29:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZi6q-0005mo-Om for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:29:39 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:36307) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZi6q-0005m6-LB; Mon, 24 Jul 2017 14:29:36 -0400 Received: by mail-qt0-x241.google.com with SMTP id l55so12887240qtl.3; Mon, 24 Jul 2017 11:29:36 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 11:29:35 -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=qnbYYX+IG7GzYSOGIFhdBZxjwL/rUovFZSD0NbwCE1A=; b=JDyMQrqPvHDomUfbjjEd7QsYfpBQ4yNcl4AZiyOUnk9pQkc/JguXeKdNjw0WNmq9h5 T6P/ywoF96dL+P0l/6+INQ/rlxtwTXOqyYI3442G6j6t/lRSDll3caf7dswFGWmHRP13 EMQkqWJwgYbGs9IQ+W4LmvkjEF4zDVsc3kSbJIhtavo2Zre65Pcq6I9RZcoA3UaWioiV XoAUrz323EPIayJWH6pmX53f38f1w61K7T5x0bJxrSizH0ygS/THUJwdWkGXiibRTwVg ZV89QP7DpwBezmf4uQ3c4l/bdy8NwA5lmOYRsFPee9w8CfY5mcRTTEvpxC/mcqVqXRsO Xh8g== 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=qnbYYX+IG7GzYSOGIFhdBZxjwL/rUovFZSD0NbwCE1A=; b=Ll+oXSVKOCKWjthWNzh6woBDWikkOn+oKuBBICkc09GtIOwOi1WdwNkJQoiw1oKm2S l5p0wZ979IMMgL8qRLq1RY1sAKdGZ56zbokeT6bN34MMyXkxQgVFDoGm+wnedp9ZSxX2 S/8ulpeKCD8qZcghngJ+jahgrWa5f1UORiR0tx/jywd3j26DuiRQkPSJRxPvTl4B71bH fpjxkaH8KBLdeUe4A+UKDd0UapHCBqhqhLMRrl4WJZK1wLyD+oHWfQyV6aTb2ZDx9jUN LZRWFwsXQSyt7f4CAp9aoJ6VUV70DyWR51yaLrhmouWcQupEmW9UNSauEOTJROC4w8H7 n3TA== X-Gm-Message-State: AIVw110JnxyVy8tNlC52691njwIM3RAUHWSMCE9BNzaJxd/JVY8C652F RkTyVh3Ui0B4YQ== X-Received: by 10.200.46.19 with SMTP id r19mr4611467qta.24.1500920976193; Mon, 24 Jul 2017 11:29:36 -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:46 -0300 Message-Id: <20170724182751.18261-31-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:c0d::241 Subject: [Qemu-devel] [PATCH for 2.10 30/35] 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, =?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 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 --- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 26450d235f..963b9c8f4b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1618,6 +1618,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.13.3