From patchwork Fri Sep 23 14:55:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 609196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4456CECAAD8 for ; Fri, 23 Sep 2022 14:56:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231527AbiIWO4U (ORCPT ); Fri, 23 Sep 2022 10:56:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231755AbiIWO4R (ORCPT ); Fri, 23 Sep 2022 10:56:17 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50103.outbound.protection.outlook.com [40.107.5.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12F4D110B24 for ; Fri, 23 Sep 2022 07:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NzjCxdvXdSwYilT3PqYV3u5kwmVr0P+ZB4BW8p3UBhBbzVUKTaTijBD5Jc8bEz7fLMXTaGRfFfupuRgAmizYS0WTgpJcWLaHcnNqimkBiwTRGqy9B/GY3IIY4Zprp0nEYAXW9dAh5TIM6EJU+xpenKGOyiplpDNXHxVAD8zJbWGfyGCIEn2PleQVJZktsx5q9Pna/NJXmvKesz1m8RdY7qupdzo0bZrLLlkzLR9BQvGdsgLmLC0xYilfuhgNLsSLaTrkXXMwaSuUj0ry11qcmVR1t2AbHhNUnwPsUxH4A4DXoaVm4ixEfEcTN8vrmaAYxmc0FV2tDuUCicbr4hotWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Kx4n8Ey4jJHwDiuMCCRfDkEVcTiu6ibOVcG6Lobm8bU=; b=joIqKsllV1JjVLyCks5ssgmjxgKek+Q3gr7vclcZJesA/pq0Yq++VDXu78gmdnxJ04WosqPscsVf1wiFPiFn9F1tqJ5J391XvPFgFmMtRnIEMJckvf5Kk1VHuz5sy3N5SgXyDh2mhfoaReCMNq19XryOeNI+M7HyqLyf2LHKOQcSQSEubuFy3i5dkg3r+5TqEtzh5LkT52KnuX4KdQAdQg2ivbAw0SJde3D/sPWP1TUm7i8zUqB5+ev4nGWrwLjjFs90N4sVkefS+T2jtVhcgF8cbXEwNsllW4ogNPXwmnucN7JeA5Qz87SLQGMY89UJOR0FTY/VPVLqymJ5MnfQfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kx4n8Ey4jJHwDiuMCCRfDkEVcTiu6ibOVcG6Lobm8bU=; b=JbBBGXu8aGSqV4DKogj6/0ao7CKeUwJhB4fvOpWLppmv5oO1UTmiC56Sn181hIvJQEQIRsW7oi7VH+Bd6VkRXnTjNqS7JDlowcQ5r5UMQYBX+xCei4UPcAp1kI3Be2yPab77QcSkccGpGLEMgI9HUtRcb7a3G46YgdZP2gpExA4= Received: from FR3P281CA0162.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::14) by PR3PR07MB8259.eurprd07.prod.outlook.com (2603:10a6:102:17a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Fri, 23 Sep 2022 14:56:12 +0000 Received: from VE1EUR02FT012.eop-EUR02.prod.protection.outlook.com (2603:10a6:d10:a2:cafe::53) by FR3P281CA0162.outlook.office365.com (2603:10a6:d10:a2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.9 via Frontend Transport; Fri, 23 Sep 2022 14:56:12 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT012.mail.protection.outlook.com (10.152.12.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:56:12 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:56:11 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Date: Fri, 23 Sep 2022 16:55:54 +0200 Message-ID: <20220923145602.25872-2-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145602.25872-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT012:EE_|PR3PR07MB8259:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f89161c-8631-480c-fe55-08da9d73c1d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tJwAmqaA0FEpAPW/pM6b9wFasVfXU01PuJVRFk5FBwHMvLCEaMVJRpVZmOl1tmBb9WxTc+9JUbmDN9tpHjwohhDFGLDuuMWcj7oy5Ng/pvTa9sAzXbgTNJibSBgCZ6DmAaGCwM2qEyMRlsFKpOALoUtJ5ltc4QjdZlQO3iYVyI4I0nliC+Iu6PlIja5SzYKnEG1TcIRanlUMGhOH06YtUPxF8vUEXw7ITS3VeLETSe3MGJZFx0yxiDjzgeA8GASdcpMsMULBTl9Eb8irdGb0mHpdmKZzTqKc2BJR8eRj+ovZSxzwWr8ePig2QYTAgMgS9KDtZ+jYYP5ontuLgJ2P2rMTHAK3D7lunlKT0nV/fJKmV6WnvrASLu4Gv2NRNS91IyNm1oDXUpDeG7zTmYe5QG9rIgtW6KYuivNbX8k40ATQosa85ig2M2ga3AXgYDqkdipnGBeKWlcQ1+CgaoXAVrt+LgGHkcqIzXYmpKtUH1VKDFCJ9ZZx/K3e7gZ4rhEvDLMKkKbcldULPL/JSXJhX7CDzFQjgq2b/FD/YHHTidFfHoaX2Eqlanns9yX23quDBQIP3tc7oInSlWzR8HPpN0ThhkC8xl1BbpFkne9FsxfWqiU0p/xZZOQFNXjecYPVYWXSzXU2aFhvIbhKBofwjo328uib8cFkyM4dX4EngdleKgYzp2mB/7GWpIVxsMsbNs5wv2q60bmMRK/fzG24D3sQ2VQUDI3EPaQvfYpv6Wt82pfplUSFTV4AtYOc9fm0OOR+fq7AmgGIQGGUunVTKA== X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(39860400002)(376002)(136003)(451199015)(36840700001)(46966006)(186003)(70206006)(478600001)(82740400003)(41300700001)(8676002)(4326008)(40480700001)(6916009)(7696005)(26005)(6666004)(316002)(83380400001)(70586007)(336012)(1076003)(107886003)(47076005)(81166007)(16526019)(356005)(2616005)(36860700001)(86362001)(426003)(2906002)(5660300002)(8936002)(82310400005)(36756003)(4744005)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:56:12.4155 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f89161c-8631-480c-fe55-08da9d73c1d6 X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT012.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR07MB8259 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org "secondary" isn't an array of pointers, so the iterator can never be NULL. --- src/advertising.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advertising.c b/src/advertising.c index 1fe371a9f345..15ef44def031 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1055,7 +1055,7 @@ static bool parse_secondary(DBusMessageIter *iter, dbus_message_iter_get_basic(iter, &str); - for (sec = secondary; sec && sec->name; sec++) { + for (sec = secondary; sec->name; sec++) { if (strcmp(str, sec->name)) continue; From patchwork Fri Sep 23 14:55:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B575C6FA8B for ; Fri, 23 Sep 2022 14:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231719AbiIWO4V (ORCPT ); Fri, 23 Sep 2022 10:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbiIWO4R (ORCPT ); Fri, 23 Sep 2022 10:56:17 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70108.outbound.protection.outlook.com [40.107.7.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB3E1129CB for ; Fri, 23 Sep 2022 07:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K1BnqZAPSQFGje4MfvVngnxAxQ5jyCVe3NrGqx3UU6/o3GlVfNFp4RQtMbeGAZ98+IhD/157v40quHHro5aUa4lh1cx0hyQ5Dbe8vgNLJF1JS4+8wPDeeXnHLlLG1SrziPPrrKhGGT4EmHFQzBUpEktVjnJxjfyPcGVwyRQcFW8P2HEu+cY3QUUsmwvpNbsg60Qlf8arFPVsLFtLd7aVOH0fye0VMZh9eQv/jjAWIDdGmqoYu7+7U/poezXx00494MKEmvCLxikhKD1b4pLCy1jLu+cVXYTM+nFtcAFYLEXU0HkiJil2IWqobuVo7llZ1+ducI/4GTwOLSOZFGfkGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oT7+XSYVFkBlRYE25jkQKl8TL5RpEgPSJsNuVPt5dg8=; b=enlVdx+mZ5nuUF2LP96U9sVLlQSMtKoUELcTttI2oOtmSqjp8g/bGOF7u5XPfDdpln5RLiqpJ7JaHJJgj71B6TpEa2wJY8bBZpFckuoYL5OwhusuTrL0bz67a8+nFRrdz/yphtPoAeMo6FKvp1FhqeKuYLZTgxuChPOQClfxm+Wx3CTXKKW0N6bSp22COWqLj+cfzZjFW98TwRwHqbqCWiIvOKu/6q4zr+pYilnRYQguF0PbCLV0tzraQ8WSeE8Q0pkJ8APnuZfIuqxeUd7fJP663ODbB2WGrpTQAQk0oa3dXXLErWaOfrtTXOUrFH+WyGQQKBE+eSrnUHM0wDor9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oT7+XSYVFkBlRYE25jkQKl8TL5RpEgPSJsNuVPt5dg8=; b=sRsxezjCloE5rGTwvrxsUJVcO1i7JzKJoNGqXiqcMbwnn7HWN76yIeE4mpsynTMhcPhE8+VGq2xGxhpQjidPRDFBpa+U/xaye5HbKtyVQ1mxD9Fjl8rW06hBZ5Ub3HUW0lSddd9UJs9IYF8ra5QPh1OhQlXMzKHY2ZHNAkP/Og0= Received: from FR3P281CA0160.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::15) by PAXPR07MB7758.eurprd07.prod.outlook.com (2603:10a6:102:135::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Fri, 23 Sep 2022 14:56:13 +0000 Received: from VE1EUR02FT012.eop-EUR02.prod.protection.outlook.com (2603:10a6:d10:a2:cafe::f4) by FR3P281CA0160.outlook.office365.com (2603:10a6:d10:a2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16 via Frontend Transport; Fri, 23 Sep 2022 14:56:12 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT012.mail.protection.outlook.com (10.152.12.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:56:12 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:56:11 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 2/9] advertising: parse_secondary: fix mask value Date: Fri, 23 Sep 2022 16:55:55 +0200 Message-ID: <20220923145602.25872-3-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145602.25872-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT012:EE_|PAXPR07MB7758:EE_ X-MS-Office365-Filtering-Correlation-Id: ffaff608-b26e-41ad-577f-08da9d73c210 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E0dRkZM8wm7er0V/P4O+pkr6fTWzsu2omgUGqiyh34c0C0/pAchsja0s4tFOx8AxDEnXy+rQ+heLSbhPYrYIhk/h8K0FTzBZYJsElopJiDvcWSGoCQNdxVUP6AahxJcKt0LPX//2OuPp3cYtsDKnl6b5eVJ/B5bnLkLM0cV4gsgnryHkLbnP2DZc0oFZ5NyXGyV5QQhybaGRZmBgQlQXzecCYP3v0R0TxAmaNqQ6L+qt+7IOxdK78eBQ1ikxPH4zzyI/+N5PXvqXKOzfQrmm9D8z2Pm63frFIv9zNlx1A/ZXxl1t1DPNxUi8s3nD0c44r3/HeFaOy67illDhwRmHDUse+wqOq6BIOistTiYFGFV2opy4zxaJPVVi45iLD8/OxVQ4RCBCMYRrJMapdjxk0wtXL0Re6ncM4rR1jhgAtTX6jlTrHolIVJiIl5Z7AWxC2xdRxupGiqiGIqyh5Juc57n4YQ4vclNpJxLEBgOj9EgZmk5ILBr/WPtfvwJAaMHasiE4FrBJronqh7RadQcf1KKaRQtGmlg6p23yOip2c0cgMkXvKBaIMcsMb/R5+L64RjXYHzcbQ92oAdQQxrttcs8Xf6zsfYGiWSy1ALQqQw1LHAHhF1CnBL5a44sYBeEG8vsGEut2ahq1oPznpIb9bC5uwaCvFJMO1n0wqZBOrocqpf2sM6P2bIH+os0hXN9qLK3oTInhFzEeBuexmyJpYeoSj1CHuk0zyaFU8X3648RJFuKE9yHx//xNTGsaTtSuOFdsfIWAfazM1PIUdgPaVg== X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199015)(46966006)(36840700001)(41300700001)(5660300002)(8936002)(4744005)(70206006)(8676002)(4326008)(36860700001)(86362001)(36756003)(2906002)(426003)(6916009)(316002)(82740400003)(2616005)(70586007)(81166007)(356005)(16526019)(107886003)(186003)(336012)(1076003)(26005)(82310400005)(7696005)(83380400001)(47076005)(40480700001)(478600001)(6666004)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:56:12.8478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ffaff608-b26e-41ad-577f-08da9d73c210 X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT012.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR07MB7758 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org It looks like a wrong mask value is used here as only the bits mentioned in adv_secondary::flag can be set again within the loop. Replace magic number by preprocessor macro. --- src/advertising.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advertising.c b/src/advertising.c index 15ef44def031..42ac627604fe 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1051,7 +1051,7 @@ static bool parse_secondary(DBusMessageIter *iter, return false; /* Reset secondary channels before parsing */ - client->flags &= 0xfe00; + client->flags &= ~MGMT_ADV_FLAG_SEC_MASK; dbus_message_iter_get_basic(iter, &str); From patchwork Fri Sep 23 14:55:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 609195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B799FC6FA82 for ; Fri, 23 Sep 2022 14:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231868AbiIWO4h (ORCPT ); Fri, 23 Sep 2022 10:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiIWO4e (ORCPT ); Fri, 23 Sep 2022 10:56:34 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20114.outbound.protection.outlook.com [40.107.2.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4D68115BEF for ; Fri, 23 Sep 2022 07:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lm82qConztU3acubbzLyrHn4CyPnzT5MXePWjJ23jHsIewZBSlcsj+KY/TnLJIOEHHnz9aA57BLhM/yC3VOsRwJKPg21QSGf3ZlnObu/RwSOJ8oPclVVAS+0N+oQQs+r3sGojlwt79SfxYyOZWsIrD/emKPuWJzCbDmVBOmj5y72FJ0b98tjGl3vHFdwzmDAx9pX2zMY8q4AtzwEOfFAqo4SQWEfmMvqKn9/Y5EQf6hU/UIZRAUNvU2h0DWJcyZwPcMDmQRtBrp6Gpxg+r708wLluPVKIspahcBVDmq1VSMr1UthMGsbcOC6hIRyU+AaRFOhEBo1A0HKmwFJCFeNFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FjbxFr4iddCxoS3QntGD62ky+vBohrSJzyTxRk0PoQU=; b=MfO5+Ua4xQ/PHGXRzph2x7GUHlbuSyZ/Pyo4a+5lWbHvIjanmhq2pEg9KsaD+G908Lm+LPJxRC4PtyqA40RespILXaAbM5IofS2QkRWck8V5VEOywchOp651hdCg4e4uqn55xzG4XHo4UAtRhlTjOVUOeNMoD7NUgLjSk6avHfbeJs9vesfJ9PJnyf0yy37Gb1ac23bsbS/djXpzy8TVEoJhAwUKy/1f+iOlXpWCrYESEwKxcnuHKz9Nw+SMuWigrA0w3o4RrTxxGIn4QAiSUym3nMfj1pjmHIBmI7kU+vACaw3pKY4Y6WgI5xjdvI4Ug5btTHpjZvRgLY394FxIQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FjbxFr4iddCxoS3QntGD62ky+vBohrSJzyTxRk0PoQU=; b=dl44vbfpMfuyjLOXithwB7CvOxviVSxzTUbWsWBViSF6SfQZqCBBxlmQgHMlTl35wEfJd0tD09u8kGrggRZv4osPp0/7zx184xumYpQjVNx0F3iDQjPL2mL8z8wOh+zNyVJKpfv7K7bQgMlO3knISLXoLqA1/nz1XMuNPIImFX4= Received: from AS9PR06CA0635.eurprd06.prod.outlook.com (2603:10a6:20b:46f::7) by DBBPR07MB7499.eurprd07.prod.outlook.com (2603:10a6:10:1f2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.9; Fri, 23 Sep 2022 14:56:28 +0000 Received: from VE1EUR02FT084.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:46f:cafe::11) by AS9PR06CA0635.outlook.office365.com (2603:10a6:20b:46f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:56:28 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT084.mail.protection.outlook.com (10.152.13.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:56:27 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:56:27 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 3/9] advertising: parse_secondary: check for NULL iterator Date: Fri, 23 Sep 2022 16:55:56 +0200 Message-ID: <20220923145602.25872-4-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145602.25872-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT084:EE_|DBBPR07MB7499:EE_ X-MS-Office365-Filtering-Correlation-Id: b23e515a-a347-42b4-505e-08da9d73cb0b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MvedsCCCglsDpqyQOfbn19QhRFweCsToOOd66nIGJGS2kOKWbftgopMGPANuVFJmX8RmTO/acXoSAhmiQ8JnRkwWpVsVUkzmOv2Gcxhtqs+TEO8eKz8JZOhuEaxlo/v59/uo2cZfNV5KwnDNYaIui8Mj5+rm+0pm4FJRU89SEoThQ1ApcAK+Sz0G3tA5MitqGY9vl89CutjBffWrMCqu+dZhryDPAI71dlksjpLbmRGPWc+voikeYZYMvun1Tx2HQrpLTYNDU0xSXPmyuTfb7BQbnNOElNYPOPPW6r2pz5UI59HrQC5xB+29bP3+cRh/riCSEw9msXFlVnnrbuCAmRC6fevX0NMvpoCafJagQA0K8KNsEzoju8nM2Byq5nuxeEOfTNskVsbSykNCjLW5yBBv9Iai5wP1YKlSZAVlcZDmYAok9ex4+pqwhGJ668s4Lk9UPs2vkIvVjx58kQOFMVMRdhb+4zTo7w+Bk3bM6CCVMlVDv1QdvM1RQBuaq+GCwfVcR4N+IhmxRl4z7vuVK6HtYMeR/jD6ihTKsg+/hqTAsHfWeiaWdj3IUu4t3cbx0QquJDfiauLGcEc/mP9v4htOPnniK+SyoKQgVONkl/FydwkrYrzyB8zUY3nphJrugj3l2FVns5WxLITiMBlEloIqPHschsSNOTPcQNhIMdiophpDDzEibh7K5r7IQZvAZEJibomnM8+mNPI5IJjGgINdriKAbMuSQxrIDlquanX7FYbgSS0WqI55Z8qOnxsEic50XpOYeLRIWpW2jc1+JXTAxfLNP0AJhzQVCTscRkch2/ne8dW+YhEhKQGoKM/z X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199015)(46966006)(36840700001)(7696005)(478600001)(6666004)(316002)(82740400003)(356005)(36756003)(81166007)(6916009)(107886003)(83380400001)(70586007)(36860700001)(40480700001)(2616005)(26005)(426003)(47076005)(1076003)(70206006)(186003)(16526019)(336012)(86362001)(2906002)(8676002)(82310400005)(41300700001)(5660300002)(8936002)(4744005)(4326008)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:56:27.9193 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b23e515a-a347-42b4-505e-08da9d73cb0b X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT084.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7499 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The passed iterator can be NULL as in gdbus/client.c::properties_changed(): ... proxy->prop_func(..., ..., iter=NULL, ...) +--src/advertising.c::properties_changed(..., ..., iter, ...); +--parse_secondary(iter, ...); ... --- src/advertising.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/advertising.c b/src/advertising.c index 42ac627604fe..6d8d06edd34f 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1047,6 +1047,12 @@ static bool parse_secondary(DBusMessageIter *iter, const char *str; struct adv_secondary *sec; + if (!iter) { + /* Reset secondary channels */ + client->flags &= ~MGMT_ADV_FLAG_SEC_MASK; + return true; + } + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING) return false; From patchwork Fri Sep 23 14:55:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B08C6FA90 for ; Fri, 23 Sep 2022 14:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231490AbiIWO4i (ORCPT ); Fri, 23 Sep 2022 10:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbiIWO4e (ORCPT ); Fri, 23 Sep 2022 10:56:34 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2112.outbound.protection.outlook.com [40.107.20.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 513C8126B62 for ; Fri, 23 Sep 2022 07:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HeQyxRXBcDhUShN3/KCf8arUIZXylViae+gFBTBXHOZSfXsr+Ba3MOWdO9G5sZUuaBv7lhaec/eH3fZAda74bXa2dNwwk6v5CqIGQN8CzbhT2amsao/hqmsGSboRIlfqQL6CqGbqhTcD7lQa17YHMR4JVIVC3BibI7FNliOuol5SpGQR9OIUboPcKcfMG57dnEdEanGAhv8ch/SJ9lp8u2Dim8V6wviargiaRvzc1B7bIRXvi9lu/j4u81GsW9Ln+74S0+NUucnMw6+IQ9jtacFHmpLiRxxi9O7wJN6gANjwrkkGzvRtsFYLlWQcNyzLtWDRGXVbxpxy/joLCLO+5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jtlWoDHzNopj+BVHx9q7iaBrxukZTMksACG3+HW6T+s=; b=ZoOnkjn+K4odxxZizMh7StFmxBz2KV4amfdQ0mirMuXo9FEz4840NcHMlDecj6/fAssl2PXcw3gS3QKI0wQFCDCQ/YN+GZEi2znjCq2/AgWzVzO1wXMXWOtH7Necsa3Dj4SYVoMAK7/358SG8jjnFS54JUHVxreso2qWcxjohmspRJRs0L1nR+SvgPDNGgztqIzoVeXTDawxY1fC3YBLgOF+MDH7RSjp+lzakrnjH7+K1AofVsBUTLhrB7Mk71HitEFecwlATzgCxqdAf2zTUSdGRBFCk1U7xj3ZARXkuAo4Zi/YMLvRzn+Z43vBZGJHfzoUfbaDnC3f//T96QleVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jtlWoDHzNopj+BVHx9q7iaBrxukZTMksACG3+HW6T+s=; b=zicRTuazScWGOH8DuQX2EnVkYtm0vGuP8c4PcTiLhIHPsFXNrwLh1KwNvYmRq1O27dbFZ5zljIvXl+EWSVA3xanYD4k088iXO+CU0cbqqb/gpfu3TJs87iWYWnNb9A3dEhl9mfAhhLTjG4L+fyJld2izWkqugJ68DpE9906+jW8= Received: from AS9PR06CA0654.eurprd06.prod.outlook.com (2603:10a6:20b:46f::30) by DBAPR07MB6487.eurprd07.prod.outlook.com (2603:10a6:10:178::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.7; Fri, 23 Sep 2022 14:56:29 +0000 Received: from VE1EUR02FT084.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:46f:cafe::77) by AS9PR06CA0654.outlook.office365.com (2603:10a6:20b:46f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:56:29 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT084.mail.protection.outlook.com (10.152.13.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:56:29 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:56:27 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 4/9] advertising: parse_min_interval: reset min_interval if iter is NULL Date: Fri, 23 Sep 2022 16:55:57 +0200 Message-ID: <20220923145602.25872-5-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145602.25872-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT084:EE_|DBAPR07MB6487:EE_ X-MS-Office365-Filtering-Correlation-Id: 209ff42b-e0c4-4604-6be5-08da9d73cbcc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DJWBllj+q9V3upW0AN0XOlS3zJtgQ7HQsXAWBvNbCA082rCsnrrN7PVlawnlFleAmiPrm0D+S9rKCEwSotbZ7CWjja+j/PjZf8dXccRJNoDAal4AZLqIeCrnYgQmT7r/+Gb4NtKCLkp0NRtGCoXzpDHYlWQdLY6ZYPmFyIYO/vjQ7KKes0Yc7gr+1W+IWt1lTpmVK21T9UQVuGNINIFx7bA0oiZqMDOvaeHLtI2FO5EQl6hM6eU67ugTmmGxzrF0HXx9HxJnNQ9PPMNC+HF9VBgZp86Yh+5P3V/Kf0uUxW4WZq06bwD5VQNAadtet1j3YwZWtIGYV57SsbQiVr+OVgB3DavlUQIaInFanPH+1gGT474p94EwPqnTr+RIgTUxCUVK+DFz2JMj2nqnRhjjuzWTZXaG4k9kVZAc96sautwLhUlpn2stsrpvfrK+1YmK2CZuobPugO0tlBFa1lS8gEW4wHsH4LSuhW2ndNbt4wRt4/ugwIozGsWy9nafgTIn59kD/EJJf93qTq4dUM/tZ2ePJpPv+JFR+gJf+cIDZftYdWKz1FvhnN1z7YsD/kdb2NZNEJKE83fcxta8Lt2d9LutAzekdCCtmpcCYguZ7pwIPEVGbgWcvJGUVn1asra9HSyU+Kx2EeSLBGlC1gCoiN4zUv+GaPhFpHGBjeG1eEiNlXOGaR3yVEOLrM9jHC2DHV9D0LfJqDHNy94uyndtoRuc+7ClxFVIeIpbEJ3qXKsH5wvePoGrkVO29156/KgJyLh15Lz/jr/1VCwD6IO2w3y7nHgkG2zyZp6ADsi8MrJ8qUzXi/XEXbo51rg9RvdK X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(346002)(39850400004)(396003)(451199015)(36840700001)(46966006)(36756003)(26005)(81166007)(5660300002)(70206006)(4326008)(6916009)(8676002)(316002)(41300700001)(70586007)(40480700001)(107886003)(86362001)(7696005)(356005)(8936002)(6666004)(478600001)(82310400005)(83380400001)(16526019)(82740400003)(36860700001)(336012)(4744005)(2906002)(47076005)(186003)(1076003)(2616005)(426003)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:56:29.1849 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 209ff42b-e0c4-4604-6be5-08da9d73cbcc X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT084.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR07MB6487 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Set property to its default value (as done in all other methods listed in parsers[]). --- src/advertising.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/advertising.c b/src/advertising.c index 6d8d06edd34f..fbfd90b4e300 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1087,8 +1087,10 @@ static bool parse_min_interval(DBusMessageIter *iter, if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) return true; - if (!iter) + if (!iter) { + client->min_interval = 0; return false; + } if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT32) return false; From patchwork Fri Sep 23 14:57:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 609194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DCF5C6FA82 for ; Fri, 23 Sep 2022 14:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbiIWO5p (ORCPT ); Fri, 23 Sep 2022 10:57:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbiIWO5o (ORCPT ); Fri, 23 Sep 2022 10:57:44 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2106.outbound.protection.outlook.com [40.107.104.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB43115F4F for ; Fri, 23 Sep 2022 07:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S23VdAeEw8JAWNYY3xOzrdP+dM77fI9ZoZbfCD9A7PikM2jgQP9IT3dRMJap/3FP2MJQMoiyIVP6rxIPTw/bAm/WgOm60j3v+V0buPYScEQBzsTO9i2i2gpa4UsKnLJvmWhdQ+xYgQp3+yGwrUBR9gMshjWHNhBeBL6+3KhuE1qnUtNkDpI2l1M07xSvEWzoev0yTjjtGxFKOu9Osg8kDpM/WvN4QWEcZhf7Ie6yzUOc1JZGDz0gSxEOCKUao4tQZ9UV/DGWhnywwWk1R9t0m/dhdHhwmlBRJiR6Jdi9LtfEVZGcAuECa3ofs5A5H3kF3MQZdRpqU9/rKLfcukg00Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=20GxCM1TBI8yh9oi30c2x/QL5EPjeVyvmbAQDgsqlyY=; b=KJg6FkVBN+br3+vrzGs9gIW4TreZi7PTE7Y2I9SxyEcymz6TJ//uDy628VeZ8R+wsvSgzNpwMPUWnXy1yXIrylHLJOW4cWsutBJl9jetaYYXrYy13xrl1tFLc2OggESNdawZxVaP/8uPGBtzTlcY+l94IWeYk87Wtx4sC7L7jhtNylQBg/jVFIs+Y80A7zKyuKifBAKy4TDqnDF1RAyFjgkh5OBKLFH/nmA7L+Wrv83eR9Q0GwhZj/9wH9m8ydPkqjqyFhWS4KA8O12Dvb0cb6si44yDRt9dWCPeT/N5FhNJaIw500xf6fd+U0Ma+fUnBau7qOYPYyqSlwnkdAFftg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=20GxCM1TBI8yh9oi30c2x/QL5EPjeVyvmbAQDgsqlyY=; b=gUIzP9InQlFup1XES9wBw35lnEhvv7IbZRkKIvNjvzaAXoB1gEGCFdSyIc4VWZA4b9zFXDkvzaqUzFhokiCaB1vW8gS3s4IbUXwwoJ8+CoxwHsfB2jxB0+zSc5Go5+zYMBufp2jxIq0tp4wLvzAEQQAzpku+LaoIQi3mTxCHmpk= Received: from FR3P281CA0095.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::7) by PA4PR07MB8392.eurprd07.prod.outlook.com (2603:10a6:102:2a3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.9; Fri, 23 Sep 2022 14:57:41 +0000 Received: from VE1EUR02FT101.eop-EUR02.prod.protection.outlook.com (2603:10a6:d10:a1:cafe::c2) by FR3P281CA0095.outlook.office365.com (2603:10a6:d10:a1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16 via Frontend Transport; Fri, 23 Sep 2022 14:57:41 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT101.mail.protection.outlook.com (10.152.13.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:57:41 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:57:40 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 5/9] advertising: parse_[min|max]_interval: reset value if iter is NULL Date: Fri, 23 Sep 2022 16:57:31 +0200 Message-ID: <20220923145731.26014-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145602.25872-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT101:EE_|PA4PR07MB8392:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c7c8717-5f1d-45fe-52d5-08da9d73f6cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zwh/MVZNDzKENhxy8w/JWda29ugfk246A/go5RNSXXO2otadcnCXGg9AsT+wcG8mt2X3VritIu/p/L1Yx9PFcpTU1vd1lgEq01qntFDUmNlYyLw8KQtHk1nd7vjX2JEDhBGjZ/Qlouv1uH7VE4KH/UMFas4lMzhuHPjnvfLUXkiLiLdyesuIgPA4OaLqzr5lp+eOym23ThYzMzkn5sh025hdZWsuCIKryloUJzkC7udvz2KP0IaFul72lQ6s5wxil9sEgypP6eMCfAPnECWMhHI3Ff6FSWAOx0B+c/QiDhOC7jhftS9CGyHauZa+UAIfwEb44Agh3oK01qf5/WbTSl4S/51Gvc8Q9F007zR1j4+wKlB6suX3hPlan2FeNXUX/eBvKCQ6GMxk0guvAlW0kNqzveSGMYuMEmjsgBKs8P8zAsDDavLGs0gy4F4O6yoQq4iHxhyDNr3YePp2GoZyKqCBWAO6IQ01x0FKaeLzUi393/fhXuePZnHenIcNo4unwRswXqMwwBn8TF0cGhygcHs+JQs5IT/0n8gyx4oiekT6G7YS5k+yC7Z0JTk12iqumwMRub572J1GGj/n8As7Nl9gh6w9Lj013U3Jg5F7OYpFi5yM2EoGEcy/q/+nGpBMHyRhQWNfnQ+Jv8q2Hfo9yU4u56x0GHB9yTbOwUOtL51GdnEgA5E9O0dH7PtCaTm8QMZl8z3UWUGWdpdqeRHi0HZ3TkYsIZCGvxPnNa7Ga9OIZTc8RASeptAgEqvxtW4lF8TNaaqsSR43RdHDpQtrQVfOOZjDJYabwm6JJNSHcx7iEhoU6nHwxgD6F1CmdWuO X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(396003)(376002)(39860400002)(346002)(451199015)(46966006)(36840700001)(83380400001)(36860700001)(7696005)(6916009)(426003)(5660300002)(47076005)(82740400003)(186003)(82310400005)(16526019)(356005)(316002)(1076003)(81166007)(336012)(70586007)(2906002)(41300700001)(26005)(2616005)(107886003)(6666004)(8676002)(4326008)(4744005)(8936002)(36756003)(478600001)(70206006)(40480700001)(86362001)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:57:41.3328 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c7c8717-5f1d-45fe-52d5-08da9d73f6cd X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT101.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB8392 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Set property to its default value (as done in all other methods listed in parsers[]). --- src/advertising.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/advertising.c b/src/advertising.c index fbfd90b4e300..25df2297b3c1 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1120,8 +1120,10 @@ static bool parse_max_interval(DBusMessageIter *iter, if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) return true; - if (!iter) + if (!iter) { + client->max_interval = 0; return false; + } if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT32) return false; From patchwork Fri Sep 23 14:58:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88A51C6FA82 for ; Fri, 23 Sep 2022 14:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbiIWO6e (ORCPT ); Fri, 23 Sep 2022 10:58:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbiIWO6b (ORCPT ); Fri, 23 Sep 2022 10:58:31 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2102.outbound.protection.outlook.com [40.107.20.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B8E611CB09 for ; Fri, 23 Sep 2022 07:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UIvMC0hoVgYD5NMHzDOZGbY9IxB54u7weyYEoIqpf0woSB85r1YJpKZ3ru7K7vBJvVyEs5rnkOmtincWuSuQNKD5oqBfJW9LVGWWHyh7Id9oifxSlVRcOIR7sNZ56HzO2i9AYElakPbyCv3Qg+wRLqE/wXCFfaUQJDER4zWMzc3BcWt8i+vlKrtrLG4A4OgxzUFm6IkXCzqmlldVDEi/XYdn2lWqMgJd77JHYiqIucpT7tDsNGArz57tB6/ZfXgJsQh249GtJAyFbsWsmWte+JeSA3iL+m+V2WyGDCKezKtqQlk3Q64bQcGTn8khzwESSieqCtUwEExxFbz9XWyEbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=y7Kk0q5xn5naleEfJu53J/kxWhCv147kuPzhvuzCRmI=; b=cBRD2qRGV7WOkjwchxV5D/29F/vxXnExQAJQB88H6Tlcv6diwbNPOStDcIAx4QLYE4oZpfqRZnY17rgMKF12POUniGXGFJqVFNd/WgZXPqrqJWVpjVo4PP5XXJu0ehG91VHV6mrCmkRuPct/EIQrxGdKK+JmE7/s19eC1TdO/77kiWlGOYSFCd+97g5Q/B9AdLIEGgU8iKAA5mCiYgw2nVfP1dyBJary7NdsnFAfs2IzgbVz2qi5Ltc8jha0irpQGmlMtxs7gu2tLa4tMOVAW3fnO1x8t/b9abrdLdR1x4/IAzugBG5o1GQI70jdqCtWYshdYkeCV7XXo4WknqDCuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y7Kk0q5xn5naleEfJu53J/kxWhCv147kuPzhvuzCRmI=; b=nOPgGJSkUt55imS5ZQY3U5MuyFKlR7pB/qNFFRzicnHs1Bvfufv5H3ZxjgA9XSGTDvQWhhqal0MwZFkdaCyRz02ebCrkVbBjizbAwSiP9F1IdEyoTvwIlJsKb25270307PCNnclP6OYe6+IM+q/YpW4gVke5QVLmxzKoxaw5+HY= Received: from AS9PR0301CA0032.eurprd03.prod.outlook.com (2603:10a6:20b:469::30) by DU0PR07MB9241.eurprd07.prod.outlook.com (2603:10a6:10:42e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.7; Fri, 23 Sep 2022 14:58:28 +0000 Received: from VE1EUR02FT107.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:469:cafe::38) by AS9PR0301CA0032.outlook.office365.com (2603:10a6:20b:469::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:58:28 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT107.mail.protection.outlook.com (10.152.13.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:58:27 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:58:27 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 6/9] advertising: parse_tx_power: reset value if iter is NULL Date: Fri, 23 Sep 2022 16:58:11 +0200 Message-ID: <20220923145814.26077-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145602.25872-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT107:EE_|DU0PR07MB9241:EE_ X-MS-Office365-Filtering-Correlation-Id: 9178b28d-648d-4ee1-e6ac-08da9d741282 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yl5FhKHaEpd8kwmwdXwQFCdCx6aRM1SADtlMBx7fcyT4j/ozivQThk/J714x7CYH+y2AwYGYXQAdjyS1YZu/oR+6mB/JTNOrqnKXcgCwaeYjAYherh6gZdfr1Isbzx6eLwSlgUYAk8Pf4Y1TzZ2Pu2G7Eq1ycSe28FaSo71DLT5/dOuXu1yHKygF5j8cmW44YrUgGXPh1p3wg9ebd4FB9JPAKowIexTjrcfV+z+mm0kU98hbmf+5UYx7Q0+Bv3FbUHblzk7cZr8TXeIulrq+YVobwvvaX3tj5fRgYR9uksqMt18HaEwfgfk1Es+Evbj5aFgKwFDDQw7Pv5VnLRRH2NGXknqD/GddOGkfp8RvgbaEGAb9NYclmiLJ52+7os296RhUB+CLNGVZan4gPSRY+OTBm6kpmstNEPbzDDOzHBwbr7NdiaxJ99eUoeJjflgj+bV0Ps8rzImKqnEhr7Bf7c1Wqc0ZM42gN0pENIwwaPf2X9k8pdtaF+F8G8J2GoSAOQv/U+ydhyIr9naB355isPFhqfcyHB4dbb/8sN0V3Zx+WB1I68FNxVH23GicRtb7IViOSzN1WcQbme8NJGnbAIC7Cq6qn9WQt+0oaidC2LZKyX4icn7MhxtxAwS3E1qGjFbCWZganzo4+egX4sdnvWQlPcjHR/o/ENzrt+fcJSmCjN1Gh9fQwIUz4wDU9tNoqmcJiZwFpi0WWVhj5fbevHlLc3+nkFdiaOQutKEjVIHTEAGMX+732/Rvnf2G+Nyn6+r3kSu0J1SFvv/nYizS+w== X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(39860400002)(396003)(136003)(451199015)(36840700001)(46966006)(70206006)(316002)(6916009)(2906002)(478600001)(5660300002)(4326008)(4744005)(26005)(107886003)(41300700001)(6666004)(8676002)(16526019)(36756003)(7696005)(8936002)(186003)(1076003)(83380400001)(70586007)(336012)(40480700001)(47076005)(2616005)(426003)(86362001)(82310400005)(82740400003)(36860700001)(81166007)(356005)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:58:27.8213 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9178b28d-648d-4ee1-e6ac-08da9d741282 X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT107.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9241 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Set property to its default value (as done in all other methods listed in parsers[]). --- src/advertising.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/advertising.c b/src/advertising.c index 25df2297b3c1..f9748b1328bc 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1153,8 +1153,10 @@ static bool parse_tx_power(DBusMessageIter *iter, if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) return true; - if (!iter) + if (!iter) { + client->tx_power = ADV_TX_POWER_NO_PREFERENCE; return false; + } if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INT16) return false; From patchwork Fri Sep 23 14:58:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 609193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB960ECAAD8 for ; Fri, 23 Sep 2022 14:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231511AbiIWO6h (ORCPT ); Fri, 23 Sep 2022 10:58:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230418AbiIWO6c (ORCPT ); Fri, 23 Sep 2022 10:58:32 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2107.outbound.protection.outlook.com [40.107.22.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D227126B62 for ; Fri, 23 Sep 2022 07:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZsOgfvDTV9+INle6fEOyBV/jGJ298dxAVVSmdFUbUCabh4uteSrBw5wz72MziXNEea0FeeYr+Lq4YzN05pmoe7bpZuHP9J9M6DkuRTOZL2AQymmpy9bi5s9CY1olJ3vOoHYGBuxjpuexIPtghFy7H4Uj3tq+S3bpi2dcMXGeNEaCrGriYFFdyvyAl0nO1fIqHZGMtd6BUA06pDhYQzL/0fuKo1PO7VLjasxDmr+HkBAWrEQEEKDDKSri0p3bNRWTVSHP9QjAPmhYvsd0pXTXXcdOIo4UkMWlpM9aeLMXRfH0SEtnAqo2RkV6BIINsxc176s05hxiyRscXeNbUFLd+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c2Ar3/IHr7PCHuTCmT+0HHaWWtL1ue4SMFifUCj3vuU=; b=d4CHxgVye7IuWQJKbIf0vuAH9k09KEMHsKfaxa1rOzadNjLBnjEez+b5DpAvuwnU5vIKzh7u3SNImOhUuDGeRgGtiogY+DNddhS5lB3CaoRAxa1rOqXRbyOM/uwLfbHoENtWIpkVykaPL3uJ0/JMqnfk5dOQ3QmEH2sDA5rIlk3DkBLrzwUDTyJhh04D2wbOfcy3tOpX8qiHT5AcmKpVm3W1FSJAVdDTMlIORkw6WoYjc2L6+FutbWgm7jBoVUHopul3ZMoJ+F2ydYmWrYrKKXk/DvpzfznT1ao4Qi5qDlQwzeRSNODfxq0j8whz/H0zprdVwjpxOgNSdDis1VDp8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c2Ar3/IHr7PCHuTCmT+0HHaWWtL1ue4SMFifUCj3vuU=; b=KRaZ2UrYxLPSa+nJKh0kE8JmbtdMxvlzm0QROtfsIkuD+89kX3rvBFc3WBMm663N0QztN+UavcW7K6JnFThqNXv4DDRP6tzTJ6ZoMoSFxll5LlPNtjYwOOS7ONWPSIvChaTRavIerXT3xZdYDvWA61HpIqr17pc7qq7+a3oHlI0= Received: from AS9PR0301CA0037.eurprd03.prod.outlook.com (2603:10a6:20b:469::22) by PA4PR07MB8840.eurprd07.prod.outlook.com (2603:10a6:102:269::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.9; Fri, 23 Sep 2022 14:58:28 +0000 Received: from VE1EUR02FT107.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:469:cafe::d7) by AS9PR0301CA0037.outlook.office365.com (2603:10a6:20b:469::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:58:28 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT107.mail.protection.outlook.com (10.152.13.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:58:28 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:58:27 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 7/9] client/gatt: proxy_property_changed: check for NULL iterator Date: Fri, 23 Sep 2022 16:58:12 +0200 Message-ID: <20220923145814.26077-2-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145814.26077-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> <20220923145814.26077-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT107:EE_|PA4PR07MB8840:EE_ X-MS-Office365-Filtering-Correlation-Id: 75e356fa-b7d4-43da-cc56-08da9d7412eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +5eeruld3RnHHYThsOcClUAvTH59rfrLFXfwMVdW4kO8oMuXBQuoZS9Rk/AxRuxzARBtnfphA2fBGOIc06KVGXKZfZO23nQNxG2x/uKstRF6T6/8Ko8V6CKCFyPWaa/Edni00FN4MhLNzWoCeTGqG/3NnIu/ncGIfaPqr6KBtLB8Y9GooOlX4L1rLroO0tFGS2nSr13KqcXGt3L1+9+jQVVLFfI6MEkb5F6CzD+6aP2GrpHVnpUd0h2GPXYD/AdmgdtWekpbNwRTgcgIQNMTgCJ8Wbv2G9AMkdd4+dXGyR7i46oqL9z16QeQT9o0/rZLID3638d/N9Oc1K5vCUn1cGs0ZVBY6VUDZwk9FZDSmED/LdVFIj0sEDIJR5IBCiiVRsXMxEWx+p4V+g17cwnm1WMlXhAX1R4Sd8RG4ygu2SjeKc9tUc7NeXPA6FgJsOfcNvZBGfGwq2Z0jEwSByNhP7BIPOV5i3bCkOOfEQbnOo1W2MumEkgNAburBV84ker3+jOwHQFmBN5KyZ2vqbNWKLSo2E5iOrIYVnKIhIUY5jmzNNp0MvtcNUXoIn352bsj0XWL99QYKPlOZaBoKUJ+c0ItJi1nd5HpF1JklsMOa3ou/aanK1PApZ/cpLzCKTNn9fHn/nrf341pzWq/tZMThFqYcltd7DLXFv0nW1I/lS+w0gDac5XhptXT7/5jZmeEGadeou6Meh9YD/XnDrtXXEgXFIo+AoG+0SLK/PuojsKZUieM4WyUF44bh7PXJpgz3ai1PoqXKuhlISKsT4onnw== X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199015)(46966006)(36840700001)(82740400003)(86362001)(36860700001)(70586007)(426003)(81166007)(356005)(70206006)(8676002)(4326008)(6916009)(316002)(8936002)(336012)(40480700001)(82310400005)(16526019)(5660300002)(2906002)(1076003)(186003)(2616005)(47076005)(83380400001)(478600001)(7696005)(36756003)(26005)(41300700001)(107886003)(6666004)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:58:28.4931 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75e356fa-b7d4-43da-cc56-08da9d7412eb X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT107.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB8840 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The passed iterator can be NULL as in gdbus/client.c::properties_changed(): ... proxy->prop_func(..., ..., iter=NULL, ...) +--client/gatt.c::proxy_property_changed(..., ..., iter, ...); +--dbus_message_iter_get_arg_type(iter); ... --- client/gatt.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/gatt.c b/client/gatt.c index efd736b2359a..e945b524b071 100644 --- a/client/gatt.c +++ b/client/gatt.c @@ -3003,17 +3003,20 @@ static void proxy_property_changed(GDBusProxy *proxy, const char *name, chrc->path, bt_uuidstr_to_str(chrc->uuid), name); if (!strcmp(name, "Value")) { - DBusMessageIter array; - uint8_t *value; - int len; + uint8_t *value = ""; /*don't pass NULL to write_value() */ + int len = 0; + + if (iter && dbus_message_iter_get_arg_type(iter) == + DBUS_TYPE_ARRAY) { + DBusMessageIter array; - if (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_ARRAY) { dbus_message_iter_recurse(iter, &array); dbus_message_iter_get_fixed_array(&array, &value, &len); - write_value(&chrc->value_len, &chrc->value, value, len, - 0, chrc->max_val_len); - bt_shell_hexdump(value, len); } + + write_value(&chrc->value_len, &chrc->value, value, len, + 0, chrc->max_val_len); + bt_shell_hexdump(value, len); } g_dbus_emit_property_changed(conn, chrc->path, CHRC_INTERFACE, name); From patchwork Fri Sep 23 14:58:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5E15C6FA8B for ; Fri, 23 Sep 2022 14:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbiIWO6u (ORCPT ); Fri, 23 Sep 2022 10:58:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231409AbiIWO6e (ORCPT ); Fri, 23 Sep 2022 10:58:34 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2108.outbound.protection.outlook.com [40.107.22.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95B8118B20 for ; Fri, 23 Sep 2022 07:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=exHm5JALNMAIkOQSzr3BpwUE0qtmzNznBzqtC0Y3f83wAK3LeDqh7aMgp0bzhCzRZ3jXNviTn2/DZhwmeA9W+EmbdKxs53UAm88Mlr2cY5TkY6COf2j20klPSf4BMCcTktwfAgBA/I5Xht3PvVIaWjz6fgm9SDJshnUjYlNXGIJuCwNZ4qEd47NyG750MsXArcFHVr+EuFe+Cy+Q7DtX/2ksSiRuC6N54kUiqEjrEf79JLT176wc2YfS5Gfm1mx2CcKikpyzOmsbyHKo2UwJ03VNOOCJciQQMe+QyIm6hG95so+MH+zn6U8SYpBT70xbGDJThZMuTCtlqbnWEyvGuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BmE3MKKIlxMOZt+/ILTc5UuPKfu/KwXQxlum2V0NXJk=; b=cj1ES65opK7CZgiBDS0J0PXUXMHjBVrarFBMhj6izv5bULrzarPBlqtCwQIGzSNI7vQSuFh86w6bYvol2F3a1vL2fqO0hEf6wNmF3cigCULA7E8e9AYD5Pf1ofL6AEu/B5H5zJNNMnTBZqOXQUgneWOsEfDDxQE526Zf2/e/d3tS5xJHep88UwLgK7JkmqS4rLoMOpr2uzs9Y8RZleZ4eEBYQcw5dT8yvVtuk9HsMhK1IvXmTCrlMACVcC+F4OEGrEuG7/4q5hUr6jpywEFXSgF4QkVfyokzbI1SnJXhEZhNH6XbEZJo0zEtViKRllUCh4NpvWHJ/ZiE8khDRDDgyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BmE3MKKIlxMOZt+/ILTc5UuPKfu/KwXQxlum2V0NXJk=; b=cOX6cl4s3jNjj52w4HhJ+Vue7S6T8MP9ysJLRvBKcuDufOymEQLjOiJH8pthoKjLtLJvakH4j0nbzdWQOrrXlVt369CUNicNKYipUaYUJ39WmVQ7CkRamrr1Sx51ns6/wC1mj8cZNQ4JBWGQ9zGMj2Zk6PJoTchB5tQKHFjiFTQ= Received: from AS9PR0301CA0051.eurprd03.prod.outlook.com (2603:10a6:20b:469::28) by PAXPR07MB8721.eurprd07.prod.outlook.com (2603:10a6:102:243::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.9; Fri, 23 Sep 2022 14:58:29 +0000 Received: from VE1EUR02FT107.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:469:cafe::af) by AS9PR0301CA0051.outlook.office365.com (2603:10a6:20b:469::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:58:29 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT107.mail.protection.outlook.com (10.152.13.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:58:28 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:58:27 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 8/9] gatt: proxy_property_changed: check for NULL iterator Date: Fri, 23 Sep 2022 16:58:13 +0200 Message-ID: <20220923145814.26077-3-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145814.26077-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> <20220923145814.26077-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT107:EE_|PAXPR07MB8721:EE_ X-MS-Office365-Filtering-Correlation-Id: aefe4258-4b8e-43c8-1656-08da9d741338 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ggz/9qAS7485X6wYXwvo7fBQCUoFXDOqdcDvIvJQQQAyyxoZOKEJvDsv1R05XvZPMosHcFXnpIZ0Lv0Ed1Vl7xKvCuINEyLk2Y9mJmGkE/8jLOAwr0Gv4XJ0mAMLcw1968s+YZDjxLrMlreUubFDJHwWyqmBNp36lOMaafaCsv3zPPtfnNTv4YqnTJDjTcHwnOLwnQn0RRGyaRJu29QujFs7FCJKd7lXM4msa/iS9dc8tlKxIS8pBOeRRR8laicaRk/K4XGGdTFTJeDe+LR9bKVB/i4pIe965PhRS+sG6/ZD/Eg5Py9gq3M3HE6d+r/vG8aJMqxUMHwjyl/sdSOAaSO9TfyUwWxDLpStgrDX5F9GPKT6tPU00cqdpf6e6JGI+36/WKKxF3NPhmSGlDcPXTKmzMaJizTwsDv/qPNMh8+uutZg54Aijf29QWqi/eYVDMgwM0cEYmC2C2gKBrguMPeIn7OXlrgovJ1CszwfL4qlk3Vmk5pQn/XBHLTCAgwuTSBgnkyfTORADGpoAad4SfmfmqQvbtG0X+/RPCoJzkXnywBo2QuD2VE7MnrIfRw4uF1sOxAuUmKx9nEVQBt9CrXM3s/SgoMkGqYeBPoDkvgSSbGFIQ6XqrdNCjmRCUHZ6J6yEeU27CwqNkK8rY/5ch2CKtaFmclnWFmYuURfsHpo1CfbI58F/7Qc7UGaLCOkTwcKBGS3xYXvwY3JV5v8gfRPC6D6p26c8GpWOBmW2Vd6wGTZyABwWRWKMAVs9SEFZh7aa987rj4vUSAfiCXkAQ== X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199015)(36840700001)(46966006)(40480700001)(26005)(8676002)(4326008)(6666004)(70206006)(70586007)(16526019)(186003)(316002)(336012)(426003)(47076005)(1076003)(36756003)(36860700001)(2616005)(6916009)(478600001)(82310400005)(5660300002)(356005)(86362001)(8936002)(82740400003)(41300700001)(2906002)(107886003)(81166007)(7696005)(83380400001)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:58:28.9931 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aefe4258-4b8e-43c8-1656-08da9d741338 X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT107.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR07MB8721 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The passed iterator can be NULL as in src/gatt-database.c::properties_changed(): ... proxy->prop_func(..., ..., iter=NULL, ...) +--client/gatt.c::property_changed_cb(..., ..., iter, ...); +--dbus_message_iter_get_arg_type(iter); ... --- src/gatt-database.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gatt-database.c b/src/gatt-database.c index c72f4a4d5c54..ea282d4bc193 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -2867,17 +2867,19 @@ static void property_changed_cb(GDBusProxy *proxy, const char *name, if (strcmp(name, "Value")) return; - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) { - DBG("Malformed \"Value\" property received"); - return; - } + if (iter) { + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) { + DBG("Malformed \"Value\" property received"); + return; + } - dbus_message_iter_recurse(iter, &array); - dbus_message_iter_get_fixed_array(&array, &value, &len); + dbus_message_iter_recurse(iter, &array); + dbus_message_iter_get_fixed_array(&array, &value, &len); - if (len < 0) { - DBG("Malformed \"Value\" property received"); - return; + if (len < 0) { + DBG("Malformed \"Value\" property received"); + return; + } } /* Truncate the value if it's too large */ From patchwork Fri Sep 23 14:58:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 609192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9175AC6FA82 for ; Fri, 23 Sep 2022 14:59:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231409AbiIWO7J (ORCPT ); Fri, 23 Sep 2022 10:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231768AbiIWO7A (ORCPT ); Fri, 23 Sep 2022 10:59:00 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2123.outbound.protection.outlook.com [40.107.21.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B3EE131F43 for ; Fri, 23 Sep 2022 07:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fAeAipDR7vRzfb2qA3TQz+JbwUKyByTbmCrWnmee02DaVI+xkwwaR++TaA3WyWPkkyMznF2qQfk/zH8NDrKx6Xcsi2wU+mdr8WUemUDcd4HdRWNgu0mZpVd2JtBfb3C5WylW4b2enzBVO0xRKQM9SNVFjMSwB6MoRrmKnZC7lr9gpHGB8O3XdEVU0OXOHJ1lHwSQyH6t4DuGDo2auQDUagFycI4CPxjVldgcybe5X+aNLj/9M+w8N7AV/IS4JoJMkp6dF03eu/KG2hWhFgqW48zZ05uIdBVANThDMJdiw+qrhkX3uyxmNHBB4+dq1/72ZVffmFNzCrSBCvZMID87VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kSbi6+k37guWem+w6BlluuZ8MMzpI8/vEN1ugopTTr4=; b=GO4Skc/CnImLarPz4UgbENg6b+RS+6D1quyCptNUxcqYoxb63htJIbz6yInABb68lj58IdCpswMGkykCAG7VOce5hRPWVcQIyHtPmam60lscDKotpyMgu0WgWjDsGTyRK9F0Tw1uNRdSxb/pLjtLA8Gr1PUxREusQGDMEEobxP5jJOjHKGDPVp0adIawdSPA3Mbnu6iH13Y+/i2PFeGLfRVjwCDlqjjASNen8wAz3KZD6WAprgN8hecpR9tCTanr3W5dI2WVXUyrGjtX3T0R6QFYomzhonDLryma3ggWjPICWNzPhVAAaPh00AUiUwAv0qvS2v3bv71j0q6h+uoXng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 217.111.95.7) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=arri.de; dmarc=none action=none header.from=arri.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arrigroup.onmicrosoft.com; s=selector1-arrigroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kSbi6+k37guWem+w6BlluuZ8MMzpI8/vEN1ugopTTr4=; b=f8HeioLZ4kW9Vd79DlL+qTTvslCV+dKcS667/+uAu4Z3Z/FugteL7I01L/5omHeZvfaYuPKIdZYPn47jaCijO5qOtGDbW5mN/MZlPfzAE2AlhP6H6jLRkiZvLzTvrYWZNSvKoQEfomUBxumuIo6gBS61jYK6G6bRGz6ldTQcif4= Received: from AS8PR04CA0124.eurprd04.prod.outlook.com (2603:10a6:20b:127::9) by AM8PR07MB7586.eurprd07.prod.outlook.com (2603:10a6:20b:24f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.7; Fri, 23 Sep 2022 14:58:54 +0000 Received: from VE1EUR02FT077.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:127:cafe::cd) by AS8PR04CA0124.outlook.office365.com (2603:10a6:20b:127::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:58:54 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 217.111.95.7) smtp.mailfrom=arri.de; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arri.de; Received-SPF: Fail (protection.outlook.com: domain of arri.de does not designate 217.111.95.7 as permitted sender) receiver=protection.outlook.com; client-ip=217.111.95.7; helo=mta.arri.de; Received: from mta.arri.de (217.111.95.7) by VE1EUR02FT077.mail.protection.outlook.com (10.152.13.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:58:54 +0000 Received: from N95HX1G2.arri.de (192.168.54.71) by mta.arri.de (10.10.18.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 23 Sep 2022 16:58:53 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ v2 9/9] battery: provided_battery_property_changed_cb: check iterator Date: Fri, 23 Sep 2022 16:58:14 +0200 Message-ID: <20220923145814.26077-4-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923145814.26077-1-ceggers@arri.de> References: <20220923145602.25872-1-ceggers@arri.de> <20220923145814.26077-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.71] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR02FT077:EE_|AM8PR07MB7586:EE_ X-MS-Office365-Filtering-Correlation-Id: f44ca46f-1409-41eb-5569-08da9d742234 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WuBI2wv/bTxCXThkwB0rYPVL6XyBB7z5HTnnEFWHvwvEsLZiOtjhF/LD/9twD0iD5mbDuROOflcLGAqvhMaQjWdplkVwQnO3uhitsOOxy+CnWTL0gxQIQE/c3sMhVdRQ/ExSCodj1utca8b46OmwZorO6kMFstbikkfcRRKOxRquE2ScNBbK00o7vw/zpyjkrKnNCRZRevOhmPWuETACrytZFZNqh520kDlrifI1GFExPpNVJ+QhZxbAKzPHauYcSTgZ5tucp7pFC+GvQaW/OC+IuTGkhrP1IelHw1u+GvXvl+Szoxo+3QG26J82OWjCTk/wusYRRm3cxDvFEGX02QaftTyPo+1Ib3WjdO4PfoWRZR4YGbNv/MG4YeuRYzBA7tqZ5GMy/hoGBkCEtx2FqRxc/91YYxUcn88LjcFvMP1XGBXEyQ/cAvDr56FZfKAKLzhjr2WZLmFG2Fja23CbeWAgk+jdMgqPwisyENLqSkfvsasAlTCrcPv2Om2F0jO+uesqX9C5N2AlfswdXLVYTRTZnyGQKquFL2+bXNas3mRYEpsfXBpk/Q4rkw6A/nFyoz+vQ/VdlIalrZxFRbpXdAA3LmLaHuAcvXaMD5szQUNWWWedCyxrURM/XbmTxIyhsTqebVeI9Jn2vfemdTcXXiDhJhYUMYv5lyzR4tR+GoKdsp6q3dvG/N2vNWiaB65zPa5JDhTv2/ntZfpJhYcul7SZRGmHIM3HiZbPythGaMaJrl79URzCnT4T3B/qpHnM1htgtHsW19CUCjid2KbaVA== X-Forefront-Antispam-Report: CIP:217.111.95.7; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mta.arri.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(136003)(396003)(39860400002)(346002)(451199015)(46966006)(36840700001)(36860700001)(26005)(6916009)(107886003)(36756003)(2906002)(7696005)(6666004)(2616005)(1076003)(16526019)(86362001)(186003)(4326008)(70586007)(70206006)(83380400001)(336012)(426003)(8676002)(316002)(41300700001)(40480700001)(47076005)(8936002)(5660300002)(81166007)(478600001)(82740400003)(82310400005)(356005)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:58:54.1459 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f44ca46f-1409-41eb-5569-08da9d742234 X-MS-Exchange-CrossTenant-Id: e6a73a5a-614d-4c51-b3e3-53b660a9433a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e6a73a5a-614d-4c51-b3e3-53b660a9433a; Ip=[217.111.95.7]; Helo=[mta.arri.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT077.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB7586 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The passed iterator can be NULL as in gdbus/client.c::properties_changed(): ... proxy->prop_func(..., ..., iter=NULL, ...) +--src/battery.c::provided_battery_property_changed_cb(, , iter, ); +--dbus_message_iter_get_arg_type(iter); ... --- src/battery.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/battery.c b/src/battery.c index 77fee22b6e61..88a53e80e890 100644 --- a/src/battery.c +++ b/src/battery.c @@ -252,7 +252,7 @@ static void provided_battery_property_changed_cb(GDBusProxy *proxy, DBusMessageIter *iter, void *user_data) { - uint8_t percentage; + uint8_t percentage = 0; const char *export_path; DBusMessageIter dev_iter; @@ -264,10 +264,12 @@ static void provided_battery_property_changed_cb(GDBusProxy *proxy, if (strcmp(name, "Percentage") != 0) return; - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BYTE) - return; + if (iter) { + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BYTE) + return; - dbus_message_iter_get_basic(iter, &percentage); + dbus_message_iter_get_basic(iter, &percentage); + } DBG("battery percentage changed on %s, percentage = %d", g_dbus_proxy_get_path(proxy), percentage);