Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4728963iob; Sun, 8 May 2022 23:30:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbMKRSqi0OwR6knwo2iPIBgZpiFDozxiPdEytuQwl0qDq7GQsvn2BzYskekbZgMfFlFrTD X-Received: by 2002:a17:902:d3c6:b0:15f:186a:69f0 with SMTP id w6-20020a170902d3c600b0015f186a69f0mr1683205plb.144.1652077819760; Sun, 08 May 2022 23:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652077819; cv=none; d=google.com; s=arc-20160816; b=YDxwAUw9wtVbcccEW2oW7JXWNG86U2pgW02XIxr65he4ju1Yu0+v3gGBVfgxs+TmcW /2y5ZcrnG9E77CjLCSV+A7+WI8SKXQzruilDr4rkasrubF4yIf9ZzSUsb2h81lwLxuac L2zclNKru3blpXoDvsEKkOV24I2GnFvpym4pyjqCuBfiOOWij74X2gsefFDWPM+MUpFQ 1hBx/4ZKjVRYkVRtoYT3IIQfKjaAlb1inJUBqlfYeky2lusAKcVixJ7nUNlGv1XSCsJq 7+otDGbKrTJf2veyJt+7RC++QRC8kcpHtk67I2JN6SvFJnXDrWcJqtJdRQGd7DI50ORC viAw== 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=k51ihQ8LkkLsNWo/mUW4PLawnPrCtHgqM623uPfdH/dtCE9ukT1/Vqwz9XUnkl+TfC zWH4WukLqDWhh9IWE7FFxsy1w4vEJpUkpUZ83ZDE4E+gMpbaGv6ZvjF9MbbQ1wc48m9B KwwoNm5vV+jyqFCG6yl8uDLtJpJzzP4+OgA1adIuWYZV72eT7cVB3S+EEetk6UBIiNa1 O8dHqEPSaS+STYuOG3ZRYP5g6rwyTzhL8IXXb2XcLdLapNY4MVn68cpuzo13DqEAOjef 1PMqYjLZZqkwBkWK3dfpgV49IgLyqKboBTJZm2/Jcx888kub2AWSVxcUSks+0XdMHKzJ Somw== 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 g18-20020a63dd52000000b003ab1d15be01si13516275pgj.51.2022.05.08.23.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:30:19 -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 8160D5FA0; Sun, 8 May 2022 23:26:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243068AbiEGRLQ (ORCPT + 99 others); Sat, 7 May 2022 13:11:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355155AbiEGRLC (ORCPT ); Sat, 7 May 2022 13:11:02 -0400 Received: from mxout04.lancloud.ru (mxout04.lancloud.ru [45.84.86.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761243BA78 for ; Sat, 7 May 2022 10:07:12 -0700 (PDT) Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru AAD40209D3CE 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 20:07:03 +0300 Message-ID: <20220507170703.29902-5-i.kamaletdinov@omp.ru> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220507170703.29902-1-i.kamaletdinov@omp.ru> References: <20220507170703.29902-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: LFEXT02.lancloud.ru (fd00:f066::142) 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