Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp151642lqo; Thu, 16 May 2024 02:04:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVA51mvcywcBRXZ3vh51yjbFeMWYu2kViQDvk8v+HfNdxrQ+ev9+sUH8wJstebK9U3iz6pVMiLmCiCEiQbHHZ9fChufLz5bnU+3qnBBXw== X-Google-Smtp-Source: AGHT+IEXiOdbSxrXQopdrlNWikTPqdC24agOoDMUPaKBnMBcdDFanPqskcoFgr30hJp8x3D8VfAi X-Received: by 2002:a17:906:6a15:b0:a59:c46b:c529 with SMTP id a640c23a62f3a-a5a2d3cb713mr1395265066b.0.1715850241847; Thu, 16 May 2024 02:04:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715850241; cv=pass; d=google.com; s=arc-20160816; b=uligcRY4NeFJZKdHLjQVUjIhmhXJFDHl1xLyF2gyuidOo2AH6ZXApFH34SQonZCzdg 3oHEkF18ZRYoNC/yTqCw/GPUZyNYgpTkL5dEXrgGLOsGCvfEfAsNlXui8J1CP4iPuKwi oQjP70v3DMBqkfq+Ad+GVxPl8OrgA6jv0iLM5uMjw6YV3/2LTuZc0vngeJv4rCkKnd3B DpsqOcrq/xWHf31dQilNawFO/7btGOzmjvnsd1lJpOgRL4UWba4ICJPTOKiINOqeuucR T+OKNKkBWzvcxgsnJ71jTeEDG0NAcnzsv1OM9du7TkLBOetkYsq8Fi/d0qB7pZYkWJ11 +8JA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=HMtb9mDq48vs0sQnUnQYVU6TH+VrLQWVHqMjoZHABo0=; fh=uo5u2TQK/HQlhydMwGLjBAnuDwaLxndJ/cgWTjIagS8=; b=L7iK8pNAkyZiUnlEQON3vddjEWwyVjqTdsJ8pQ7GGyYGc57PuNX6PDbsk9cHGbCRIZ b7jEc+fRkz2vn/CAIUtOtJcXRdTkgrrFay3TvtRrT7cS8sAx/rCb5JMh4BjzpsQrTeCj wE+MKahI2e1J8O1hJaA3Gg/I6KOV5kPX3+tVPLgzQf4tgvMulNrOT23qfGSHaMUe1wIS R07XaMl35K2rfdaVFBYTtlRW3RhvSL8c6DwROu4sH615N2klKv0enZ2xZGYWcLI96K2f b83g1lslH25RMgvNzEeYSZ1joXDOPusUZJ8H6K4UodeH2frOh14XSmWtNsy8ShUp2IBk B1gQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=hadess.net); spf=pass (google.com: domain of linux-bluetooth+bounces-4686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4686-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6a18si903391866b.806.2024.05.16.02.04.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 02:04:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=hadess.net); spf=pass (google.com: domain of linux-bluetooth+bounces-4686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4686-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 920A21F2367F for ; Thu, 16 May 2024 09:04:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55AA6143739; Thu, 16 May 2024 09:03:50 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 329ED142E9A for ; Thu, 16 May 2024 09:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715850230; cv=none; b=Dsawoq4XmXCsi8QIqyXMy5MinxB2dDJaKEIAVjlEBsD92KJnuZC2moWuAWYw8Dg9Ejs/SRzxE+MWTDQL4dGpBW37F2WR7qgL4vCjqRbfyGph1BxfAGKgiAf1pL4WE174D9/7Wt54JHewStbxdkSXEuSAbIeyf0RZoUdLh4AaO+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715850230; c=relaxed/simple; bh=NBJkrCOhf1LhOUZCleZrx2xtGxd/DhKz9plgXoUn2q0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rnO/3wvdp6uIYo3GRuGbAQjyPG2n+ouY0JLFdvpl1UY4q1rd8q++ob2E5NFse8QbwXJKi3dtu1WS+GhHx2SSiKjxZOkIBoBje+biF9kL5KRuTzbcNZl3dwEG/kAWrpI4cBmlRZzzG/745VmX5I4/Eq0QtCNWQCOQ/0xEaoYePqQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hadess.net; spf=pass smtp.mailfrom=hadess.net; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hadess.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hadess.net Received: by mail.gandi.net (Postfix) with ESMTPSA id BBE441C0016; Thu, 16 May 2024 09:03:42 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Cc: Bastien Nocera Subject: [BlueZ 06/15] test-runner: Fix uninitialised variable usage Date: Thu, 16 May 2024 11:03:10 +0200 Message-ID: <20240516090340.61417-7-hadess@hadess.net> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240516090340.61417-1-hadess@hadess.net> References: <20240516090340.61417-1-hadess@hadess.net> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: hadess@hadess.net Error: UNINIT (CWE-457): [#def72] [important] bluez-5.75/tools/test-runner.c:856:2: var_decl: Declaring variable "argv" without initializer. bluez-5.75/tools/test-runner.c:945:2: uninit_use: Using uninitialized value "argv[0]". 943| envp[pos] = NULL; 944| 945|-> printf("Running command %s\n", cmdname ? cmdname : argv[0]); 946| 947| pid = fork(); --- tools/test-runner.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/test-runner.c b/tools/test-runner.c index 134e26f9c691..ff5e19825801 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -912,6 +912,11 @@ static void run_command(char *cmdname, char *home) audio_pid[0] = audio_pid[1] = -1; start_next: + if (!run_auto && !cmdname) { + fprintf(stderr, "Missing command argument\n"); + return; + } + if (run_auto) { if (chdir(home + 5) < 0) { perror("Failed to change home test directory"); -- 2.44.0