Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp151638lqo; Thu, 16 May 2024 02:04:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3G0jDm24jHnvTgysGqL8KUJtWpfyYua7Q0eCUkrtiBVVU1mjf5HwtrKCmuPnC5SqWAlWQbKYcNwCZ5/bbJxx4XhA/Xg3TxjNNlPCqiA== X-Google-Smtp-Source: AGHT+IHJZmriNjKcV6Rc3p8vT2QIWVnI5cD++VPLWnP2GCY2nb+SV4rrOtV1VstKJv4nlMXDHVoH X-Received: by 2002:a05:690c:f0f:b0:61a:b568:a3cd with SMTP id 00721157ae682-622aff9009cmr205975487b3.2.1715850241515; 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=tie7SLDCOmozVzNMwHtuja+I87DiN8EcxkIR0V1I0M8F8ZqxrGCIwVuOKvC4c6FDTk L9K2I0cFRZvh2k+utDoE3X/TbOu2NUsA5D/0snxHqBErqSx/tdUqwzzKiBC9WA9QnFnG b1OB+todRDZfIOFtE+6gMR/NxYsn90PG/dlAQh4SKUM7fUBDhjiHrkx3E1AK4G7z0oP0 J/7NDkosxj6/hfLX7+oBV4O8PUYXdqlbfkw2C8N3Ca7RxdyIj5nGJrWpRhrJfJn2PdN/ KlOwvld2nxGflAyqDsWMroauteKkF98IWpjOPg5MSxmpl0ORHBkLFwMJ2EkuBrJ0eVHz AwNQ== 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=QuCUguZ8uPBVC5pfWVl4971hENQCOE5JhQuY0gBD/Ps=; fh=uo5u2TQK/HQlhydMwGLjBAnuDwaLxndJ/cgWTjIagS8=; b=tTElOJ+LehIWGjTIxhILbEcZcb6LyCM7qboA0hS1o7NkK0e9BmLhdkux4B1UL2Ul7Y 3ZgRLQDHdXs8nqSMHs7nVMe6BhIOBkzP13ub1bfFTMYaZbFGNM5JEzxoPNEFPq5A2/xV 2Ve5Kkgg1DVJe+b/o9Mo/N4nRj5dAanwpYNH/lE6guVqgGTVxqvDBh7Y90bo+i4OPYSW v6OaW7nWMjMo0wd8OKPj4n83MvmzZSCtB/2ZeC4JmAIqHgn6RxOdYhz9lZnYkfVzi6BX 64FoujMz6FRG1X0k9MlwOthLOJjGiMezodYueMGXl/Jbmz3oVJKqGAbyN8ZkKasm71Dt +oYA==; 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-4687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4687-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df56cba26si159721301cf.643.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-4687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=hadess.net); spf=pass (google.com: domain of linux-bluetooth+bounces-4687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4687-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4223C1C213ED 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 5E2DA14373A; 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 3286A142E8C 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=TK55/zsPmrwuhHqd045TKIBBp81u93eDrECUgnILHNIqm7V2in0b3eucSiYWB7X8/p+F+pE7QgCE14n6rGfhibSYZYrcnMMy+Puhng3aKnMlDbQhEFeRfoNZ4EU7XoG4W2y7mxj/c6k5oKD7iPomVG9KeSuSUlth651uIGo2S6I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715850230; c=relaxed/simple; bh=nJD3hKR3Np3JLEdiyiWo5d5x/H0q+Tf7XAmtKd6Lob8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jr8mI/wUbTCgO8YrU80E/RsTDDYQTdUT4ZM/veGx2OrqWl2/pv18fE9RrKRFzaAFxaFmasbdEpSZRQaJfsaOoMw9JXGTrMOy/0espVgnnbWRewettQHnZ0SHb8kCVCqL6hl8dharjaD6TS6jjHTtIr4ChfIXoPrX7ERAiYip+Do= 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 DB7611C000F; Thu, 16 May 2024 09:03:41 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Cc: Bastien Nocera Subject: [BlueZ 03/15] shared/gatt-client: Fix uninitialised variable usage Date: Thu, 16 May 2024 11:03:07 +0200 Message-ID: <20240516090340.61417-4-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): [#def44] [important] bluez-5.75/src/shared/gatt-client.c:1669:2: var_decl: Declaring variable "value" without initializer. bluez-5.75/src/shared/gatt-client.c:1686:2: uninit_use_in_call: Using uninitialized value "value" when calling "bt_gatt_client_write_value". 1684| } 1685| 1686|-> att_id = bt_gatt_client_write_value(notify_data->client, 1687| notify_data->chrc->ccc_handle, 1688| (void *)&value, sizeof(value), --- src/shared/gatt-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index dcf6f0211a67..8e4ae7e5e230 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -1666,7 +1666,7 @@ static bool notify_data_write_ccc(struct notify_data *notify_data, bool enable, bt_gatt_client_callback_t callback) { unsigned int att_id; - uint16_t value; + uint16_t value = 0x0000; uint16_t properties = notify_data->chrc->properties; assert(notify_data->chrc->ccc_handle); -- 2.44.0