Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4701656iob; Sun, 8 May 2022 22:32:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvPClfgQUA0Iod5+LOmdalpR8URZ9tA7ZfodF4k2QNs/SdaxZz8/kT3JojzyzyNKgJpp9n X-Received: by 2002:a17:90a:b395:b0:1dc:a402:bd4 with SMTP id e21-20020a17090ab39500b001dca4020bd4mr24846475pjr.238.1652074370597; Sun, 08 May 2022 22:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652074370; cv=none; d=google.com; s=arc-20160816; b=jcmKScRSG/LG6sIRoShSwC1eCUgAXZi+3lbVQlj9WCn7s7vbmT+rYJYkxH+JYSNE65 ygDf4JDtQSCQKN3o5SJFWZNMNHolE7Wa/zLbZQagYcO3NG+WNeU6rCqFvgrxC3ZEMaz0 aLCUMLIbsIAhvhuvcCSG4Ux81gJVaf1dx1qTJzcAnzAVlq6ZA71xnBjnsso6PM1GM6b2 zCz7hItrEdrwDZRoVSy4Yjl8JNHm41axc8NRqLmHCOrWZXdyE1oRsp9hVaC9JXPpaM5W PcGQqNSOVsxmuHL3N1nf2AaUP2cHXkZOKDsJWWpeYCtWm5xnXFal2RLjeVcFpqAhUT93 /3UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-filter; bh=WF0cYEYyXNiuyuEXydxDz7oTdwnadhby/JiWJ0kT5Uc=; b=jtsUrGrUgDXFZ0pRztnzCqIE3+B97fIVeWFqsY1cMHffc7oA8Dkht6WDlVYCUHsQe4 G69dZhNkWkfuUSECBpa3vZaHyW97sduP/4SG/UTQjD0jCpsU8mL3STrIr8oElKDjQmGf 4EkX7cB5u4eIIf5DM+Iionc3uoP8PotISI4cd/DHDtqATpp2oLuf3f01KfFnBb4ebqAc MqnQPMewcbwnar/C8FlHs6FQLJ314Uf0pIfB1iMdKpqJkwhmW2u82gUWZd7FlTWb+H7M etrIvDEPwOjYWrRZWqwMNTjnm1TLnJREltvpJVDweaKbr88KeHlpPXdRx5UYPJauFhOs T1dw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-bluetooth-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w1-20020a6556c1000000b003c17253e66asi11551955pgs.829.2022.05.08.22.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:32:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-bluetooth-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-bluetooth-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC3FA152D1C; Sun, 8 May 2022 22:32:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385533AbiEGPLF (ORCPT + 99 others); Sat, 7 May 2022 11:11:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446607AbiEGPLA (ORCPT ); Sat, 7 May 2022 11:11:00 -0400 Received: from mxout04.lancloud.ru (mxout04.lancloud.ru [45.84.86.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7824B25289 for ; Sat, 7 May 2022 08:07:05 -0700 (PDT) Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 5B4B52097CDC Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Ildar Kamaletdinov To: CC: Ildar Kamaletdinov Subject: [PATCH BlueZ 4/4] device: Fix uninitialized value usage Date: Sat, 7 May 2022 18:06:57 +0300 Message-ID: <20220507150657.28240-5-i.kamaletdinov@omp.ru> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220507150657.28240-1-i.kamaletdinov@omp.ru> References: <20220507150657.28240-1-i.kamaletdinov@omp.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1910.lancloud.ru (fd00:f066::80) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Definitely `dbus_bool_t b;` must be initialized before comparing it with current value. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. --- src/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 6da5c380b..7114e1b3e 100644 --- a/src/device.c +++ b/src/device.c @@ -1568,6 +1568,8 @@ static void dev_property_set_wake_allowed(const GDBusPropertyTable *property, return; } + dbus_message_iter_get_basic(value, &b); + /* Emit busy or success depending on current value. */ if (b == device->pending_wake_allowed) { if (device->wake_allowed == device->pending_wake_allowed) @@ -1580,7 +1582,6 @@ static void dev_property_set_wake_allowed(const GDBusPropertyTable *property, return; } - dbus_message_iter_get_basic(value, &b); device_set_wake_override(device, b); device_set_wake_allowed(device, b, id); } -- 2.35.3