From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-4.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 Received: by atuin.qyliss.net (Postfix, from userid 496) id A5459BA68; Sun, 21 Mar 2021 14:55:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 314E8BA55; Sun, 21 Mar 2021 14:54:54 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id DD14DBA4C; Sun, 21 Mar 2021 14:54:51 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by atuin.qyliss.net (Postfix) with ESMTPS id 7DA56BA4B for ; Sun, 21 Mar 2021 14:54:49 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 97FBC5C00E0; Sun, 21 Mar 2021 10:54:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 21 Mar 2021 10:54:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=65nYJCxxl8aOI /xWh9YYbuFI0KKhmGX2E5OmFtr3ZSU=; b=sHt0WXCGtxw+ZdGRlk1b5PR1qQiUF ZB9kFpKrbAqVIvA71tYKlX9zn8xIo4WCvX04F7BFFuHh6td7dBciU3302PoiSTc5 mhDNZIUbOo6nCbQxdjJZGmLSVKrKLYlpp8yiMC9yRA7quV7wx2eAlLFbrfFeJC7G dq1FYzbyAK9ufLlurzI9IqUeGfMfmG6/8If9aG75xbGtKXECXETTI6T2CZ2DVuT5 q8op3CPvWC6jeuJCK3/VwgO6IJRyKChDHNTxTFe3j84Xp0yMYORetU4X9b+R4EOy qyBf/i0Fn48V7L1n2sErOVNICVRSGPzZ5JMue/HfaorrrN48YoZthCUrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=65nYJCxxl8aOI/xWh9YYbuFI0KKhmGX2E5OmFtr3ZSU=; b=HLfAcpIZ EObJdVF0Baw3s5DQw4cTHpd/F6rFBUyfpW7EzO7Q4bfLTGLC7lR1HoDf+RvjUPOt OBDJzf/FPw+9ReQLVBJUJXstgSU6Rrr+/Bw3INGbi7pODDS1kBJkqdzYGhB9qTq1 OTDucSm5AkEh6pzfXDjoGkfZ9Zg7zDNQs98s/oLWp6RxJLV1PYljL0emV8++8Qqm uO8U8Y15a8oZt21ZQEGwlWxk21JRcT06V/EGoDcb070f0RXcJppGfp3lXbUZOd3q ixKIKdAvYBY3EjLqS2tYRWYBHV3Tgynwfm6ovxJBF8uGHh2Kv3W8UaKJmPpPnM32 DmrtxOIm7VjiAQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhihshhs rgcutfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpefgfe dukedvleeileeludefveehgeelgfegvddujedvtdffueeuveffheeljeekvdenucfkphep jeelrddvfedurddvgeefrdekudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehqhihlihhsshesvghvvgdrqhihlhhishhsrdhnvght X-ME-Proxy: Received: from eve.qyliss.net (p4fe7f351.dip0.t-ipconnect.de [79.231.243.81]) by mail.messagingengine.com (Postfix) with ESMTPA id 2A66B2400CC; Sun, 21 Mar 2021 10:54:48 -0400 (EDT) Received: by eve.qyliss.net (Postfix, from userid 1000) id 5A17011DD; Sun, 21 Mar 2021 14:54:47 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH ucspi-vsock 2/2] vsockserver: fix uninitialized variable Date: Sun, 21 Mar 2021 14:54:40 +0000 Message-Id: <20210321145440.28563-1-hi@alyssa.is> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210321145118.27783-1-hi@alyssa.is> References: <20210321145118.27783-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: CUWQDU4EQHZNWUO77V6WWQQKNOVD7OJ7 X-Message-ID-Hash: CUWQDU4EQHZNWUO77V6WWQQKNOVD7OJ7 X-MailFrom: qyliss@eve.qyliss.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Cole Helbling X-Mailman-Version: 3.3.1 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Identified by clang-tidy: vsockserver.c:105:17: warning: 3rd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage] while ((opt = argz_next(binder_opts, binder_opts_len, opt))) ^ vsockserver.c:44:3: note: Assuming the condition is false argz_add(&binder_opts, &binder_opts_len, BINDIR "/vsockserver-socketbinder") || ^ vsockserver.c:44:3: note: Left side of '||' is false vsockserver.c:47:9: note: Assuming the condition is false while ((opt = getopt(argc, argv, "+1qQv")) != -1) { ^ vsockserver.c:47:2: note: Loop condition is false. Execution continues on line 68 while ((opt = getopt(argc, argv, "+1qQv")) != -1) { ^ vsockserver.c:68:6: note: Assuming 'alloc_failed' is false if (alloc_failed) ^ vsockserver.c:68:2: note: Taking false branch if (alloc_failed) ^ vsockserver.c:77:6: note: Assuming the condition is false if (optind > argc - 3) ^ vsockserver.c:77:2: note: Taking false branch if (optind > argc - 3) ^ vsockserver.c:81:6: note: Assuming the condition is false if (argz_add(&binder_opts, &binder_opts_len, "--") || ^ vsockserver.c:81:6: note: Left side of '||' is false vsockserver.c:82:6: note: Assuming the condition is false argz_add(&binder_opts, &binder_opts_len, argv[optind++]) || ^ vsockserver.c:81:6: note: Left side of '||' is false if (argz_add(&binder_opts, &binder_opts_len, "--") || ^ vsockserver.c:83:6: note: Assuming the condition is false argz_add(&binder_opts, &binder_opts_len, argv[optind++])) ^ vsockserver.c:81:2: note: Taking false branch if (argz_add(&binder_opts, &binder_opts_len, "--") || ^ vsockserver.c:89:6: note: Assuming the condition is false if (argz_append(&binder_opts, &binder_opts_len, daemon_opts, daemon_opts_len)) ^ vsockserver.c:89:2: note: Taking false branch if (argz_append(&binder_opts, &binder_opts_len, daemon_opts, daemon_opts_len)) ^ vsockserver.c:96:23: note: Assuming 'i' is >= 'argc' for (int i = optind; i < argc; i++) ^ vsockserver.c:96:2: note: Loop condition is false. Execution continues on line 100 for (int i = optind; i < argc; i++) ^ vsockserver.c:100:6: note: Assuming 'verbosity' is equal to all if (verbosity == all) { ^ vsockserver.c:100:2: note: Taking true branch if (verbosity == all) { ^ vsockserver.c:101:3: note: 'opt' declared without an initial value char *opt; ^ vsockserver.c:105:17: note: 3rd function call argument is an uninitialized value while ((opt = argz_next(binder_opts, binder_opts_len, opt))) --- vsockserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsockserver.c b/vsockserver.c index f740a8a..b717eee 100644 --- a/vsockserver.c +++ b/vsockserver.c @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) diee(EX_OSERR, "malloc"); if (verbosity == all) { - char *opt; + char *opt = 0; // Log the full argv before we exec it. fprintf(stderr, "%s: executing", program_invocation_short_name); -- 2.30.0