Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4644122iob; Sun, 8 May 2022 20:23:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbB43ROfhy5K9uyXGgA/90fwqSTHJaun796R2JV0HFfhQ/UG68GqVD9IMvyIhtGgDv9h2z X-Received: by 2002:a17:90b:3b84:b0:1dc:970d:bc1b with SMTP id pc4-20020a17090b3b8400b001dc970dbc1bmr15658096pjb.147.1652066609118; Sun, 08 May 2022 20:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652066609; cv=none; d=google.com; s=arc-20160816; b=MeuOISoN6RyC/9337mlYwlSH212PMxaig0lNs+H8CS7jZmnWQ7kp7mSFNsCxtUQqSf 1/GnjPuWz62tkhBBxkfJviBCYPz0zvwPvn/vyna8SvFfksuiKDeLVJ1dU7PAUlDFv8CH PFgYWuz4igdZPlzUgo6+r2SLWfLkN7SqVCBQJdiZ6ohojxsEigaW46yGxFBAbiNLpi/G kJ22y9Q0Zt6UtcfjTkTh9J1HzMD3QYeVShRKYxG1yVmQl3AKtReMAt3xjvt/rxSpzgVJ 0mgIlVHwBoDqR8YtqxG4Gubomw0wo81K1GvZSjSfxB6OS/+uvhLo0BGLWMsHmncwnJdB TKcg== 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=otxCLkpjm75CwEdfnFtx146rcbLGCfVfAsTDXefQ5G8i1NZlnvDs3LBvg8uB1ZPpu+ VB1FM3Qs6XLeFFKWcH4JE1Kj5V78UIQeN/pV9YOT03kFVMFwkW3oeo789wdCp+LqJHPo CaXfxq8C7g21epjJ2uK104by5RaiwKPxljza9BFCmfH4OGAWYlYQ3hiMxTMGS+H6QtLA 0UrDA87BOA+4lG1uhdRn9ujUU0yBR2hl8t94RnLPyXwp9x64FqR+UMVgWC+JshKsr0Io l/fFpoxfwemXDbQn1xqlKoiHrF3WkklyCeKxuuRwYX+0+bb4YHug1l1UhAmBMnnr5rnT vRIQ== 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 o11-20020a170902d4cb00b00158b6f04ad1si12336755plg.192.2022.05.08.20.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:23:28 -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 08E0783B35; Sun, 8 May 2022 20:21:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243868AbiEGRjI (ORCPT + 99 others); Sat, 7 May 2022 13:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243926AbiEGRjE (ORCPT ); Sat, 7 May 2022 13:39:04 -0400 Received: from mxout01.lancloud.ru (mxout01.lancloud.ru [45.84.86.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A808022B3E for ; Sat, 7 May 2022 10:35:17 -0700 (PDT) Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru EAC0E20D725C 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:35:05 +0300 Message-ID: <20220507173505.31249-5-i.kamaletdinov@omp.ru> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220507173505.31249-1-i.kamaletdinov@omp.ru> References: <20220507173505.31249-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