From patchwork Fri Sep 23 10:24: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: 609205 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 6B867ECAAD8 for ; Fri, 23 Sep 2022 10:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbiIWKY5 (ORCPT ); Fri, 23 Sep 2022 06:24:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbiIWKYm (ORCPT ); Fri, 23 Sep 2022 06:24:42 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2124.outbound.protection.outlook.com [40.107.20.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0073D286FE for ; Fri, 23 Sep 2022 03:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NKewYyN1bDokN7hB7XqrEgwF7aLTDBPBvrplhU1Dp70YSu+3i/38w3JVp6dI0jzpMh4IeV4cy+4CjDj0DSocE798AFnLjJGNEdva4bQYJ6B6F7s1BqYBpGXkbUHyi9iE/WjT0/KcmTtsIr3FfTVLg6rGpAgmVAhC1vCkFWSS8bO/M5sOFXjRyg17DEdyybfiqZQEn3UC8X0LeGxjOFPUYETiDQwoKPS0zlRBe5DpEBJ4EWZnlP/CqL/I9noexlfruGesJGMJcHcrlj/qFCqGnTJEPP6Rs/PVIFvw7217ILAWpvZynBBzY7LRqU3pXs9TrW9fWJUk4kypiEC+x4hI5A== 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=XJyjJtoHBB/ggKmg1UJplukWBAS0Nrei1rFAyofv7y8ZfLHLiOFPc0MXwEr9SFlOEpCyFGJo5BWpETnJiJsaAVy3k9sORJL7ZWHm22k3ABzZfi07ZYzCVAhZ25eNm4b66kJxFPG+Kg03ZPyaw5BnE84pNZapjZfpCt4lpqcP3D42vi5ueC9Wl+pNobuEY+r3zzVlASDMY2KGmgzVtLVrYLlDUcP3I9kL7E0tKQ/SN6+fJ9iyZEIZ0T9upbZydRGLSa5KaeLfJF6EFwSj3jZrPbyp8T9NP/CkKv/llHn5RNluzUrG1M/W9PZRbDymyZhLnxF9kL5Kqo4Janlu/NAVwA== 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=NLEUhxJUPyvwOOlDtyWjNsWFgsPuJbo7TYjiEkXLtgkEbWulH0u0HbYdGseba4d5fGUlVUxVVVw4McEXP5sW9fID00ObBGCuMuSccC6Ju/8BeBpmhp86XwQVCCiyxJorj1eEAg2FOWyNRAiwlqOX44Xq7hLM2Hh//RN/WXmaYNE= Received: from DB9PR06CA0016.eurprd06.prod.outlook.com (2603:10a6:10:1db::21) by DU0PR07MB8465.eurprd07.prod.outlook.com (2603:10a6:10:354::9) 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 10:24:37 +0000 Received: from DB5EUR02FT021.eop-EUR02.prod.protection.outlook.com (2603:10a6:10:1db:cafe::69) by DB9PR06CA0016.outlook.office365.com (2603:10a6:10:1db::21) 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 10:24:37 +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 DB5EUR02FT021.mail.protection.outlook.com (10.13.58.64) 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 10:24:36 +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 12:24:34 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 1/9] advertising: parse_secondary: fix loop condition Date: Fri, 23 Sep 2022 12:24:13 +0200 Message-ID: <20220923102421.10336-2-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: DB5EUR02FT021:EE_|DU0PR07MB8465:EE_ X-MS-Office365-Filtering-Correlation-Id: fb0f8d89-bda8-4c19-8307-08da9d4dd0f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ARAdVxJeFgEYrROC+RslRg7HgmFmsBEGdjBqVvgIU+zLfnQXYxYk7o/9PNShHrKl+SGq2/B/tWtKETNlMv5MhXEelOV0DlVYyEEMzxr4XpYs4qgoN6QhzmnRXejTXKTMztz90O7AcMZIGK9+afWViIiKoOSaxi6dCkm16+I6rftWBk92CVjRb4ky9SXhUgMo0V8Yyz6mUCwfFWYuebwzCQncl9XBg8QjjeJFpO8m0gaEL70ArPSxgI9/hdv0/3sA6emF2vzBkKo7hr5fgnkA6u3iUaZkVK53/9vmY/v+WLUBaQPQT3LB/lp6/08M5BPZUIdmU5LpK5erJFf8aaHc/Ad458vg/S2oIHa60RkYHQisfle9dXod6qXBo2pMiOPLJ1dh2JeznDihm2Oh/bGEa238KlFbuBCdXSKPp2ke1sIbxXh6CMbz3jF5nr23Uwr95laTw1x7kEMBkMQ3j6c4TljBD5B7VtnA/8aeBa0aG5/Czwxf61AIZk/+24G26rJb3J/UOuwsD8wzCpxUXWjxAtxe6nTMUppzqQBNEi+g3tFgQTYjOY2R/N1+GEOuukRK0ryV1qeHKDMfB7KSdDKGeTUNhArOJ6g6Nt7mv8s8Y1cy/I1P+84PYhhhQIYD94zi+X+HCkcYKuvfwOa+f+44RTyxurKUK3AtDSKsVqAjR/mAkIC5chcqb/JrC4pVsWi6frY9rOQXaTpAzRPMvFwlTHHNgZr6UxZWFl67On3i2fzxOg7ra9+A1OyMqk84mPqpQO7YMBxcktrzGWVwt3WnOQ== 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)(376002)(346002)(396003)(451199015)(46966006)(36840700001)(82740400003)(336012)(81166007)(16526019)(1076003)(186003)(86362001)(36860700001)(5660300002)(316002)(426003)(47076005)(70586007)(70206006)(8936002)(2906002)(40480700001)(6916009)(82310400005)(7696005)(478600001)(83380400001)(6666004)(41300700001)(107886003)(4326008)(36756003)(26005)(4744005)(356005)(8676002)(2616005)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:24:36.8093 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb0f8d89-bda8-4c19-8307-08da9d4dd0f0 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: DB5EUR02FT021.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB8465 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 10:24: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: 608672 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 8A46CC6FA90 for ; Fri, 23 Sep 2022 10:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230058AbiIWKY7 (ORCPT ); Fri, 23 Sep 2022 06:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbiIWKYm (ORCPT ); Fri, 23 Sep 2022 06:24:42 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2103.outbound.protection.outlook.com [40.107.20.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B41429CB8 for ; Fri, 23 Sep 2022 03:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NxneDeuwIdc5rpNtDDHEOSR/r3B7KjIRymlWGAeVFqOYFnLVVKVVawXUmv0NgWIlNV8WQ8ReNPNIKIOMFD0N0DKIxUSGivLYbnnCnaMCBRqlZbCEjbSUw5mVEUC2StJQWpU29ER60EdIxqJ1U4aRGv9tjmYJzTxK3YzlXKRXmBRk/fOb/SaULZSPXy5qQcZO8YzhJEC9e6lBi0jDzKp9pyf5Wim95JveCuPRfVtxvUI69kdz7Z9hFAszCgkF6Ygl6s1Ck7HY5Fmh22izwlM0EuRKBjb0rng5JpHsKUn59weKCGXb1KIa+Tjoc+XHoBYhyA6rTXXzTLVCoWeKra43OA== 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=hTqHuqfyxSnxyNzulDLU3suUWg7ui6UMEs1VMErhIiAVki0u52CuqX9u7vthCRXg/Ag9AuIcbyoV+Ozml0xIdyl3J3Dsdmr+H/pnZliOki6VLutkqo7LtJGxBoK5DkDZLTs7wiU7zHodBm5ZC70APs/2NNFPiRyspS5x1+BurR2wOsLgZbvh0U3tA0kOQHoNSJL1Ih3HucIoKp/L6k3AP5t35XfezgzT1F7cEhilYtZPQXt5pxLKcwb2mf9tLjh18ZFSK0tG2EHA7T5NXN2ZTT8z/tV1wm1E5HxHn1yX0uojKsSz3MtULlo+VaW6riX0scxwUUfi4wZZn0Y6Z5edYQ== 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=M1jlcVU0AlHmI0KBLLIRcL/rLvlQuixxu11cZ2T3ICVzR7iDrDzMqWNHZHsJlYToFldZHr6/mzT8QYzlIn3+GYQkd7ZMTMHW0at4wpYELeOBrfSYjUxGrD/NJNKDKiGu05N6nqjmutd9YhIBg6gbO2IGV/ABkfE5bY3jBOsHa30= Received: from DB9PR06CA0024.eurprd06.prod.outlook.com (2603:10a6:10:1db::29) by PR3PR07MB6572.eurprd07.prod.outlook.com (2603:10a6:102:63::18) 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 10:24:37 +0000 Received: from DB5EUR02FT021.eop-EUR02.prod.protection.outlook.com (2603:10a6:10:1db:cafe::68) by DB9PR06CA0024.outlook.office365.com (2603:10a6:10:1db::29) 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 10:24:37 +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 DB5EUR02FT021.mail.protection.outlook.com (10.13.58.64) 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 10:24:37 +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 12:24:34 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 2/9] advertising: parse_secondary: fix mask value Date: Fri, 23 Sep 2022 12:24:14 +0200 Message-ID: <20220923102421.10336-3-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: DB5EUR02FT021:EE_|PR3PR07MB6572:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c79fe0a-d74d-4a90-0a5e-08da9d4dd119 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EOd94vfIMiUCDi/iIEUeR+bC36D5N5Y2Ij/cXxA0hb8fle29oPdXfmSmwQH1RLrex/Jr3lrjM5p4ShTn208W2pAQCXJQOYft/K1G4dFwOfQVZfkyGcIByM5qRdYoPfWYm8JNwwomkTl/z/l+EpEMdM5IoZk6PcCttkUvMIuGB/ohO7YtPm2tdZ6F6C0194q0VtMUo5b22LiIkhqnlf9bGfm+PxnBNe0UDrT+BLs/ithVdwqQqJfXtr4/o+QGOow5ug6icEVChqZ+O1QsHyz3178hq8mxw4R+RyWic57g6FTHLVSn+XGeYckkU2szIAx1z+gub6/5V41RCxu4w+nq+/SzAFLIqpXefl7MZFTSnvkDOSscUoRwoD9BLsSrs5IobN1DV9HSJsaK9/Bsz2qTk+SVi5zykzpkv8bBLUA29pDmfdi1k9dVqNnTvlOQvad9GFLqskaCYehdwUOACEyny9lmvBmFblgUUyGWdLLXbuMNxlHyD4Kxf611dKvWJNR8nYFwGBk8xiuQ57n7D6/AoE5MOgikA3eEKzwfft0op8/+O0u0sI2GcB5wDN7O5mylJNyDV2c00TxPfRNvXO7V9gmegGvnsktSVG54DrfF4qh1irz+uXjvvSveEKe0la7EdfuekA3KMWCkZYZ6KyVgdbax1kkyOqNh8V5rYm6G8oiGIlGXw6rcW5SbsAamUIyIMkaY/wYFE9eXvWVwmUqHBe8gIcRxy99/MEG/lHHBUlAvPTJ8Xb4VENC+GbOInKnWVCsozRSTG/ZOuLfjcjwnNw== 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)(376002)(136003)(451199015)(36840700001)(46966006)(6916009)(82310400005)(2906002)(5660300002)(8936002)(4744005)(41300700001)(478600001)(316002)(86362001)(4326008)(26005)(70206006)(70586007)(7696005)(6666004)(8676002)(107886003)(83380400001)(36756003)(82740400003)(36860700001)(356005)(81166007)(336012)(16526019)(40480700001)(426003)(1076003)(2616005)(186003)(47076005)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:24:37.1843 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c79fe0a-d74d-4a90-0a5e-08da9d4dd119 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: DB5EUR02FT021.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR07MB6572 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 10:24:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608671 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 A7F9FC6FA91 for ; Fri, 23 Sep 2022 10:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230113AbiIWKZB (ORCPT ); Fri, 23 Sep 2022 06:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230031AbiIWKYm (ORCPT ); Fri, 23 Sep 2022 06:24:42 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150130.outbound.protection.outlook.com [40.107.15.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A759A2A254 for ; Fri, 23 Sep 2022 03:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bhnwmHnKBbyMUP7dezNgiJFwiT3oBK+8+ulzX0g+//0pEmHy/mZyCmzWqjD5IuI+lL9UXHDZOdQeiCPxOkNShYAcXp59/Shorz1xVXlZaspHzmQg8nC45g6QRb6Dq/k+0qJkLz++r7ThHHXHiM0OX3jj0ioFaKSMLSnkvdc8pFhcj+LOCeru3Aeo/g0Zm5joqUPATyTRJ+Uk8/Z7nP5EFyQv32cIP/bIyXthDMIXv5M7AtqQRmkOnlA0oaZKxzKKFHE6/pqhSv9DP4uwrcPImRciWplYLQCp17zz0ed2jxavtGCzKygEgj/C59Xz0ERBQB2c4rQwH5yq7ai3edc5Ig== 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=b4uGEmCUNkfTXspLQSOVWhLKP9KXOaSMJY4ZudOaQvTQ3EXDeVcC8bYC1MSMNbS5i6KKAcEEbKVL415vDhFOAJp/Zu3Z2QHsP/zf8WOgpYdKoD9/x1O1QM4q+c/ihPUGeIG0Oc1nAOh4DN3NikTf3XuxskXmuCegOLErCDgN8xGKSgiwrs2nmyVnH3pO5jCAj+qNSFRDt5PZJHpri1iaqBuTny6u28RpCiv+W8H41O/70pubBu3ZeSLOrFLHV7WZVnRvBeZ0CaeQW3vhC+ujWcANAtgfrX4/Qck2R9xY6U9+Rzv04/I7E2xcOWVWwZpGYl3arv5CeDstN4fjpwxGFA== 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=YcWL8RRjzm6dnTt9vJG9gsK1Y9IwjQ5CMaPsViZqnx4FAG1Og1F3Li2js/+KPXpZ4mg6JHqV+xFEhPaWqZwGQAZ7ujSN1x6fd8urgdRU9BTq4Q0h3TcBHMrJ4ENJUx1h4+b56f9gqvCWk4OvRhUUKxPMsPtqek4GHklHXyvrw5Y= Received: from DB9PR06CA0024.eurprd06.prod.outlook.com (2603:10a6:10:1db::29) by AM7PR07MB6359.eurprd07.prod.outlook.com (2603:10a6:20b:139::8) 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 10:24:37 +0000 Received: from DB5EUR02FT021.eop-EUR02.prod.protection.outlook.com (2603:10a6:10:1db:cafe::25) by DB9PR06CA0024.outlook.office365.com (2603:10a6:10:1db::29) 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 10:24:37 +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 DB5EUR02FT021.mail.protection.outlook.com (10.13.58.64) 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 10:24:37 +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 12:24:35 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 3/9] advertising: parse_secondary: check for NULL iterator Date: Fri, 23 Sep 2022 12:24:15 +0200 Message-ID: <20220923102421.10336-4-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: DB5EUR02FT021:EE_|AM7PR07MB6359:EE_ X-MS-Office365-Filtering-Correlation-Id: 7de2754f-027e-41af-41e0-08da9d4dd152 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hHFFKvkHZNuZ+Q8mw2H2TujlK1y3i+BF6eN4h6wevd8Z/ilVA5wZ2JPs4ezFj9PlhTSQBNlKFIqdnBfIEhUmtUZGXR5k4+VsSxn9AyOXgG2Mt83ZtyEzG9R998Jr//3RFKcwURsvaBnTeBsgVATjypjqV2Z3WXaVHZkoLk4N3vLwnj1N6s7xdKVyLLPIGMFjfMpjDlSR86OKriYEj+btrnArsgUpQp3Ih4Lc8BmyowJ2hTkO2y0Xpv+9OJbDFff9aESGUiSA2NGQtrbIvmgUnTTcwP8l3CLpFOujyI7DYDu+zdZ5+geTHL2NyfkQG/RuFgAnWhwaGz1GD/tiEyxqHwqyoWX79Sur6jFh4yUXk5jRPnN1CfTUW4CPCPA20/fCUe6E62jrDGgp+WgeAvm75v/YHVtLFdqMKgHcCCbqVztOE/zjpZfN4MXjZRykH2Yxvn08Je8rOf87Ha8jeBpliUvv9Zt5KCMgNSEc7s1TOcXmW5tvYPY2xL5CjCbRDjSKjMU3jOIdqVBANdv/vAVvjx0SiOWJjr9Md3RTCBWRaUVTXTtxLdCNhbcw3DSM9buKDTsCSFcgLBwmKnspwbVCzfpF3rlAkrhNlAebL8z0om9AgkwPkm/Uerae8qs0qnrGELQYHiJ4xpyoBHJ5qbXyGL5SjjsK/TDESup2KeSTjVFvY+HH0LpDQkII29ONxOaF4P6O1aAP5POOYxPE10+/mcMZxuyowyHlC+NBZ7ZgY5Xz+akLTI21xRuW1Vy/BHn4h3FHBKfYAUUGHVkFSCPbK4u692bCDueh13ezLjZIhaFpM42wAWSkCV/4r6w67e/s 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)(346002)(39860400002)(376002)(396003)(451199015)(46966006)(36840700001)(8676002)(2906002)(186003)(8936002)(36756003)(16526019)(7696005)(26005)(4744005)(5660300002)(4326008)(107886003)(6666004)(41300700001)(36860700001)(82740400003)(81166007)(82310400005)(356005)(336012)(47076005)(40480700001)(83380400001)(70586007)(86362001)(1076003)(426003)(2616005)(6916009)(316002)(70206006)(478600001)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:24:37.5436 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7de2754f-027e-41af-41e0-08da9d4dd152 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: DB5EUR02FT021.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR07MB6359 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 10:26:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 609203 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 B2AFEC6FA86 for ; Fri, 23 Sep 2022 10:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbiIWK0f (ORCPT ); Fri, 23 Sep 2022 06:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230197AbiIWK0M (ORCPT ); Fri, 23 Sep 2022 06:26:12 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2133.outbound.protection.outlook.com [40.107.20.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B016C122634 for ; Fri, 23 Sep 2022 03:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d7f8KgGno26jOosnZ+LfOqjZ4ivizYEyV/XJwyUHyDgYlh2XAclJ+vkqrOgtDYkb9IYpgDdZ/V2FYXHePcXBXjONdcSkzazzdufTEz8dUCYEAx2LeQJ1s+agAvdK/Ccp0W5giV26NDCD1GlvO2t25jXJfMF+UpyaUNl7Sw4KiOf+dSDFwEaWz8X9aZ7sHRuGhwLU+Y+Mb5va5p3ksGteP8oFXTi0AosvMQIHPstNACIpWZ389nRHD0z52YHNCfkATk0zetWl0M6FAN2rxmTMmgghHRlOgodNiu8pkrOPPRL+9PgTbvvcyItTbbQn3blNb38mbPDczbvphaFpPk9grQ== 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=G97V/cvx72k3P/PhElVgBO9ee7iWOuyNfNP4Bktj/FDEzupn1wAFIuywVovJgfVrM94Dd93MXNfTgef1wYUL9vVeUUZQlE7qbIu7SDDE8cpE9axVq4IlUICr88SuN7KSLo1YetxV/vOyxj8BF0TqabKlIc+OSkiPVLkuqFayxQ3CeXj4A/Av5b2aiOG9iTBxHIPv2PnUbm0/JZRfa+k9Nf2QJoEZMcM0cycXxwz0IsHDpgPzEzFMVDlcYPtYu5PSvN00BpcXb431t5H5zpw9vKBgIMA89gsz3itvfJmS0uhN2LLEkWC/N40ZioBJTDPjNschqN6A2HiWvCWWsmgXKA== 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=TI8hPvbrtxWTKZd65+zAC5HiVTQTB9+DPuS/HnHU4TnxwTpxMobQcYwX3/imFmZNetUFyvUvKQYOLcBEa+XQ46EM6HFJkUEO25Z7/QJag2reVzQ4Wfnboc/HzwDUeWtFG/roj1jn2yX9Isn4asd78MB92pY6F8WBMuOAPRUt0CY= Received: from AS8PR07CA0036.eurprd07.prod.outlook.com (2603:10a6:20b:459::14) by AS8PR07MB9042.eurprd07.prod.outlook.com (2603:10a6:20b:56c::22) 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 10:26:09 +0000 Received: from AM5EUR02FT086.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:459:cafe::13) by AS8PR07CA0036.outlook.office365.com (2603:10a6:20b:459::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.8 via Frontend Transport; Fri, 23 Sep 2022 10:26:09 +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 AM5EUR02FT086.mail.protection.outlook.com (10.152.9.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.19 via Frontend Transport; Fri, 23 Sep 2022 10:26:09 +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 12:26:08 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 4/9] advertising: parse_min_interval: reset min_interval if iter is NULL Date: Fri, 23 Sep 2022 12:26:00 +0200 Message-ID: <20220923102600.10455-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: AM5EUR02FT086:EE_|AS8PR07MB9042:EE_ X-MS-Office365-Filtering-Correlation-Id: cb3a0faa-84d6-4b07-b5af-08da9d4e07ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9qnqf8e1wpBOoeu/l3MQaKA4HXfh7+IaRayI8NqXoyNWiMnrEXmMFl4e3ns1LYRLHZ6a/6hDo4y0yBW/F9dB8z8/o6tr0sbOsHCxzehvWYDDJ8DU2j2b0hGau6ZpSjSCPtmHBQcjFnUphhea8zILOhfGs5lTukWVZ+CoJsgs/e4RYCvm6WYIGaHeqwtKAUN4yR3u4JzGipAJRkZbrxn5LbW4j5bLC5umyrRx24vdt5f9/qIQ9mNP443ryu86NlnYLEcTenEBXEkwL7vlKQOQPDuVIMul3xtI74yAlAb0x9UqFXxq5jCgKpFbRj2FvADc2GcStT9tTO4ggFr8C5A2MNW1VZz57xwhR0MyUsqQG4L+WS7tH4+LDoJ5y8szFs3asJ8nrCOQK6fDKKJJif7GeWLGCehZPzwLdPccUAxdq3mO/wm3+8z8YBbxm9K5H+wryIYDfuleBN05B35PLK3PTiYYri2XFay7L/cskHVxrYcrz2giBQrzm7aXrFoJ168RicYi2uRaSuCcoNdPYwXHx2LXriG3HTPBoU33s3VKjd71lJRCC2sXwMWswuBCZIzLGWfV6ZANml4QfTjKhg7Iubdui8KP8nFzB7AqgOTAVBefQvepEuSzCIw9uTTQlmy8X3oNs1T+/13oupgN4qi3WNrDgCuP5zEXD+DSx+cHAvCZJXxF9BUd5wT/5z2HKPQZgh0rJ7jktN9oeyjapkMNzxzyXY7hgBZU0SwVJeolK49Id6YtawXHJMuQojiklWVl1ZELLXbmcQq8j7gy3AZ13OpP428wMxwuvHR11PIESxOKVAP9LmDAwi1WStjRXVV4 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)(376002)(136003)(396003)(346002)(451199015)(36840700001)(46966006)(1076003)(16526019)(336012)(186003)(47076005)(83380400001)(86362001)(36860700001)(356005)(2616005)(8936002)(82740400003)(4744005)(70586007)(70206006)(5660300002)(4326008)(2906002)(81166007)(40480700001)(82310400005)(107886003)(26005)(41300700001)(6666004)(7696005)(478600001)(426003)(316002)(6916009)(8676002)(36756003)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:26:09.3086 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb3a0faa-84d6-4b07-b5af-08da9d4e07ff 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: AM5EUR02FT086.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB9042 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 10:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608670 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 1C587C6FA82 for ; Fri, 23 Sep 2022 10:27:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbiIWK1G (ORCPT ); Fri, 23 Sep 2022 06:27:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231150AbiIWK0n (ORCPT ); Fri, 23 Sep 2022 06:26:43 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2135.outbound.protection.outlook.com [40.107.22.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E599E12B5FC for ; Fri, 23 Sep 2022 03:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m/uSEvzU0ec984lS8ppYDnm+/mtVzXY8qTSepfT9zHtHEdIZceKZhF8EOrbdgxXXfjGYs8cuY/a3LJXUJ65x59OmtoX7NdG7mWX8tk7l5cKMIXlfyiFTFAhT5cn5DKW2crmfkDq+9u1JZs/Z+/eEo2Jwu6rulLCijS2wcIqee8SD3QasNEZKTIbHddwqD8ZYgeecofyi31Pn5DoZXVmBJbF+k5UeBliizL9ArZZ3ryAwSyVUDBqvDQMUjTxQqHkILVvELOLkyYFlD6C1uo+vZhSFDObSw+5/84MCggg3eQ2BuWk5WP+lMnqSIKXRJZ2OZmrJTVDtUf1jfbJui3T4+g== 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=b+BQVIUpc9cs/PFqXohnPZru8mTpbwsOxySOpyauJMGoyj3hn/bDX0yP2WnpI74+n04BNWaZreg8TfgzE1XVYnkQtAPhN6m9Ohviqze1tiOgSaEvnTDPM4aiBJjqI216Fp/gsZLt/slN32FruVcRf5TIrOhZ0IA/ePXx/p5pf9IXwZElK9bjneeFuvCw1FOHO0Wsfa/Z/2KchEYdN17OUHQNuAVche8UA5GJI/j3iZRKxx1aSedB37aY7rCn9ft3f+OsBF6sOfppAmjFl82+mNQYSOI7eBpZHD/sz2sFkXfrJDK94/T30ZjUQdgvfELoPDXcCR97NBMKydliGfDYkQ== 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=xG5JkPJd/XymP1Wbueuc+ngEqrHVP8NpIFM0Vkb0UG5NbfX8+KY/NZo/6gSWL2ay2YwF26YsVyTxZKFv2A31kiTK1WPPG1ehODg/p4Xzb3F7Sa9YRYs2vrrG07pz9oOnAVL9fj8I7fxSa6em2I6u2/dMe27U0zM5zURLiQcVgXo= Received: from AS8PR07CA0056.eurprd07.prod.outlook.com (2603:10a6:20b:459::25) by AS8PR07MB7669.eurprd07.prod.outlook.com (2603:10a6:20b:2a9::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 10:26:40 +0000 Received: from AM5EUR02FT086.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:459:cafe::77) by AS8PR07CA0056.outlook.office365.com (2603:10a6:20b:459::25) 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 10:26:40 +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 AM5EUR02FT086.mail.protection.outlook.com (10.152.9.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.19 via Frontend Transport; Fri, 23 Sep 2022 10:26:39 +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 12:26:38 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 5/9] advertising: parse_[min|max]_interval: reset value if iter is NULL Date: Fri, 23 Sep 2022 12:26:32 +0200 Message-ID: <20220923102632.10502-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: AM5EUR02FT086:EE_|AS8PR07MB7669:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c38812c-0930-40b0-85c8-08da9d4e1a15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +jX8/Xp9C77PAgvbVVCThDQWnsvaJB1xg8JNHrFaX0tnvTo0TR7RA2XRGEWu4tJAblanRyQf+BVFEisNZH+DHxy5ADLPs2RxIrhVzTxm+GcCfy1F5Iwo1NpoxNZ5J9tfnyLAMzX8YkVcNQ3fmJsz33L30h67bG0KKo5P0KK6UUzRikP/azQAxkgNwmCYTU6aEtFnDMa95U4bL4kkRM8shWDPVls+8UMDMlQrXAWS1+T1P5Au9tJm43hIzdafe7/4dcbj5iX2m64MrqttARpKuKJNOii6NouW8h86HiSdjdfZVRKOFRqKnxTFDPd12e76wlpPs3AX3/zJ/aZK6AbkFekFVyj0/YTd8dV9jrbFmdzK+FE6m5LYk5OJy1/DdSo0g2Kul4ic7WH51TQ9Rhxj1ozIedzzVPuIUHQkcDLcQ7KcnioNjMTAtfH4RX8KLRR4LNYYUtJni2v9TZqr04qRuF69pahIr3KjJ7PpbchIdnaueVzVP2q11Vjf88Y7HbahDY/4GJ0ooRz4hya2HRnQILp5//qeS5/gOphrqtZSUvPintrjbUvalOVENF8Aq7xnNRyF5da7RgeF0M4D8UP/F7cP+XwLbXC2IvBOa/Tm6FZ6agQzPmfxWN2GrAhPZm94pxEY/Vxq9uW1w77XAPZHKUB69KnGaNmdFjcHTciPoQJ5hH5/zvjT3buUXz++v6YyJUDVnY1vuPbRu8HxwH6oY8AT4eBnuKe7DhDEpB0E2Py3lz7MgMTglcjmZI+B4Khn+HPh9+wvc2NaMTbM3wxjOp0BOQrgpmheNXfH825E9pOzDqKoFbsjEczSZvozz87n 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)(396003)(136003)(346002)(39860400002)(451199015)(36840700001)(46966006)(316002)(26005)(5660300002)(4744005)(2906002)(7696005)(70206006)(82310400005)(8676002)(107886003)(41300700001)(36756003)(6666004)(8936002)(4326008)(70586007)(40480700001)(83380400001)(186003)(426003)(336012)(6916009)(16526019)(86362001)(47076005)(2616005)(478600001)(36860700001)(82740400003)(1076003)(81166007)(356005)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:26:39.6505 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c38812c-0930-40b0-85c8-08da9d4e1a15 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: AM5EUR02FT086.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7669 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 10:26:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 609202 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 79326C6FA86 for ; Fri, 23 Sep 2022 10:27:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbiIWK1I (ORCPT ); Fri, 23 Sep 2022 06:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231261AbiIWK04 (ORCPT ); Fri, 23 Sep 2022 06:26:56 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2128.outbound.protection.outlook.com [40.107.21.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AB861288BC for ; Fri, 23 Sep 2022 03:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dBPR/42gAOHhHKg7V/5ZA16Cu8NP2jNiWOZrR/l54CkXjxMlyUeUm5mQlcYgb6lbLy8MV3kphopfaZ1lLHkKtQH8ee2DI+y+6U8It4FayljnJdD5/HB7g/nyI0/fkIkGQRFmC6QpJqnVjUyaQKte13szTk8Ai/fHj+woXfCfMv7zHbgk4FwnbqM9lAYV4kP/lObzqBjnm3vMI9z+w2QzYd1e4M/iyUpF6z+8Z5OiTs8VF97UQE08e9K4tiGW2A+tNuuY/9Y6r2VJCGnfdGAA5lwyDDIKtPU4Q/FAvmEJtCsl4Ya+k63SCwDBONj4jKeyEwvP2lYZpgl/uOxZOT28Nw== 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=n89pgY9gI3YIkvi24P0SD0BMjkqOEAu9M+C9K+nnLe58ZNSP+CUy6gKykYp3OQXmcXp935O8F2r9A8Nd2kikCiV322BEa9UB4UE3LWk3L6TZXdKgXLfWu4XOEFOzlM774h4CSqDUT8QL9kcXmGZqtbhAQk4Shk2g6CgOi8l4o+35Ty1Z66lrY2ijMa7ie+jPBVNmeWVX01yBjpuHuJ/ZjljnD8VwMFRB1w50foKBYG/+xpo7pFxL59mElGgvKseuL0z2rLVbvriORL7kH/577fleqMM0lHMzbBZyo8QLhqg/lVn3pxxd6IIMiAARqrE43nQso9PXDc8w1cZzZbNrgA== 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=jI6xEuyl6x77S0jxRZrBsOkmKxb11M4xfhmzRSttoHwPPOtz/5MMjWpy+dkAAtfJQ+gCUN5VB7EV5FPUgYRiP6uoVQbdYPcEJ+osnMngD3TUMoWiPqDssBPMTsIHq3frsPCu0wJ2/zHAZfXb5Ei22RTDs/yPhQBtveUCgLiMhBg= Received: from AS9PR0301CA0034.eurprd03.prod.outlook.com (2603:10a6:20b:469::23) by PAVPR07MB9285.eurprd07.prod.outlook.com (2603:10a6:102:315::19) 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 10:26:52 +0000 Received: from AM5EUR02FT079.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:469:cafe::fa) by AS9PR0301CA0034.outlook.office365.com (2603:10a6:20b:469::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.19 via Frontend Transport; Fri, 23 Sep 2022 10:26:52 +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 AM5EUR02FT079.mail.protection.outlook.com (10.152.9.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.19 via Frontend Transport; Fri, 23 Sep 2022 10:26:51 +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 12:26:51 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 6/9] advertising: parse_tx_power: reset value if iter is NULL Date: Fri, 23 Sep 2022 12:26:44 +0200 Message-ID: <20220923102644.10526-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: AM5EUR02FT079:EE_|PAVPR07MB9285:EE_ X-MS-Office365-Filtering-Correlation-Id: 265c1e0f-eac7-4619-fe76-08da9d4e2160 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: POZKqNQR/1z7zbSP6ApoPGTDZL0twAyHTNyYU+uI+BekZuTGOPhwTHuVvqrD+K2hN71pIILcMfZW2UYwyJa7f0XuocbAGUURqzpM5xL2rzeP8iL1EMOX++gQmhqbbyOCqQa05Yyy0owaI6q3uQz2Ah0AdMxzrMhD05ZDLtRWQXSy4D4vQLJPO9zb4sKAdnG86QaBQNkhFNZypV4Y4giAN02KseoITSJYJLrcK0nU2GFnl6MmdboC8nV4UEvgPbaFDaPBojQwPIy9rM1o7dVUQd9htHuNOVSXZgbOSKv6Odq+dqiYDLhYXL750nv+52J8V+/N4aDiqVy9uf22ApaKnE/cHwG0yKTUkgBwQRFrTWqvqkxlvcFRdapVb2GG9VSLGTU4eKyhIqlHukHAK2/Os1a3ep9yPSangBYKbsc607bQ57TEeSDiPD+KEtf2vxk+ifgleIq8rpAlq8DHRGFPaWP8yBr/fQ0JnYBteOWnFPC//ryuhBMwBur253Y0PEjOGexbRecoMpDBnxr4M/TOKbu/fOkhKe6pai3pmU610Asmx+rHg3G1aIn7s6lNIXEZktS7bBSJ2bUPdupGuTFsDmtphuB51L9a6rFaf1hJniu2BLoBs7OtjVfj3FwKYcicqqZFLLJPHAKk6LeX2OIXQ2sGNmPqdVjdKers1fxPuhCTNTVs5Oc2S2SEEI4RctuStTBSvd8cYWaCJyQQra6LMkbQejkqAZk2GpAJaSbh+JgCBZZ1ZTmXui2HK30aB+R3iX7NKsi2objfvfK5sJNujA== 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)(39860400002)(346002)(376002)(451199015)(36840700001)(46966006)(40480700001)(36756003)(82310400005)(86362001)(107886003)(70586007)(70206006)(316002)(478600001)(6666004)(7696005)(8676002)(4326008)(82740400003)(356005)(81166007)(336012)(41300700001)(1076003)(2616005)(5660300002)(16526019)(186003)(426003)(47076005)(2906002)(83380400001)(36860700001)(8936002)(4744005)(6916009)(26005)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:26:51.8906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 265c1e0f-eac7-4619-fe76-08da9d4e2160 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: AM5EUR02FT079.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR07MB9285 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 10:26:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608669 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 AF2EFC6FA86 for ; Fri, 23 Sep 2022 10:28:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbiIWK1j (ORCPT ); Fri, 23 Sep 2022 06:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbiIWK1O (ORCPT ); Fri, 23 Sep 2022 06:27:14 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2125.outbound.protection.outlook.com [40.107.22.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E284A128A00 for ; Fri, 23 Sep 2022 03:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LJ43ARvOtXcPBBBdc/wcEu7w4d5gT1SwRYmqP6+TNlYjhv3jmxrgFvhDWPVMNAJ7F6vTEoxVovV4i1EHjHhS5XteVT3yOhi4/Isxdy7RzHRt3saHRysD+3sxB2sMyl2JtQdsO3DbZj3AdQM1DzkdPa1ynd6x8Qt65nfL3TJxxCxJsC7/QMuVbZPHhTOWSHM6SHLFKGTSqIwQH9I6qDaaedwadJdF8yPcO2BYg7OWyktLNlqGkra86rnwZ82hXDMl2ZS5QL7kjo3G7r/O7mXURJla28SghmTVzqkSRIXdpz57s/LtinFipOwBlSbk+yF4qS1ToO0SVIKtxZlFyTy0cA== 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=S0fG/vhW8SJYh7la0GWZb0ZZv09JXSHwOOqg2rG5Vj8=; b=c4KaJnbbviywqk9W863wa3hD8WxQKNHNAL5/ZA/zPSYVDCu4b/MErT+dknbTCOntq2GYU1o9T552pmFZ+awmHidm7L+FYanlgFYjP45kquoBJJydovCFKXpcddqyh6Ju/s4Nasp/UEP4D0PjNHz84mT5PZM59+5Qy2NEhGgfKRAzf/Zvna0DpsjmB1pm1NUlMhI7nWx5EbmeQNU2xaVwd8ck42KdOnw020JmLteZjp64uss7BlBcJ6do4Y7Wmd5UJKmpprTMihUWAL7yhORkcQwP3eszvs4INxfSlgVph7efPo5AXvOrR9NCUmNliKv5jfURkrjgHtFuie4HXYfpYA== 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=S0fG/vhW8SJYh7la0GWZb0ZZv09JXSHwOOqg2rG5Vj8=; b=TvbjG4Ai30UxIo2VPCZ1Gv/DqZHu6kLSx0b0XSwJUEx5Lmi4sv/XoHgsLF8YNj5LlOO3s0XGTQr0to1U+HQ3He/TAUJuMgRSyWNB1MheVVejl4EyvsHZvZb/WVrc5sDRiwaKRI3+JdxsSyB3jmc+OzVLxNLED6gpKZAjzQbzqGY= Received: from AS9PR06CA0297.eurprd06.prod.outlook.com (2603:10a6:20b:45a::35) by AS8PR07MB8054.eurprd07.prod.outlook.com (2603:10a6:20b:359::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.8; Fri, 23 Sep 2022 10:27:09 +0000 Received: from AM5EUR02FT062.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:45a:cafe::65) by AS9PR06CA0297.outlook.office365.com (2603:10a6:20b:45a::35) 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 10:27:09 +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 AM5EUR02FT062.mail.protection.outlook.com (10.152.9.216) 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 10:27:07 +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 12:27:06 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 7/9] client/gatt: proxy_property_changed: check for NULL iterator Date: Fri, 23 Sep 2022 12:26:59 +0200 Message-ID: <20220923102659.10549-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: AM5EUR02FT062:EE_|AS8PR07MB8054:EE_ X-MS-Office365-Filtering-Correlation-Id: 582cdbf3-4ccd-43b1-c7cc-08da9d4e2a70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0OzST4Dz+iS6XEBz4L88gmA9AaZ5MoAZibTO64YTsmoQbsowBaBeqswcoyq/DAVLTMVFB8k4C8As2GQoSdtCov+2pUCtvzusIAM8zs9K2jBl7Ejwa3et7tNHfKEacJTmGOL8SbvRp7Fl8EcJrgTSaFn+TYEdw12VOyeeqy4nbn9fAPXh11prDbgji0JgUsDYLxHlsO9gz1svSnBbgvqBGmveNyqtNTdYu8kWf6gT7+5aqs9PmJ8cpyeqneP47o1/5X8groBRyodGCgf/LsvsyFdV14nyhTS7CBCZQNc5v0H8CZjyGw7MlCVpAEQv96/8wfepHlAnadKA/HBEwrUaQRL5OFST5t5+u1zFZuz8VnGnMeS/Qt8Fm0Xtto0P4iCOC8iWprimmjZSVDrbHe7xeABJu31j8B62hEwqtZLlH5upFviENqhwqtyW1O4EwCBXg4CT6vUVBgKdkvZ0h0EzBpEbOI0wor19tu7O7wRx/AbjbQ8AWqfdThZLMFgWN+2XPfl4aysvArvqrUmt5S0xHnYtQ+yJwg9x5nDxE/aBFR/wxawqLpcKFJVGx4s22vbH6mZZ9DadaIAa9ZThQIerPG6BzesutjBUi4I3uZsvSY9H6JqjYQsu1DLrTakncf09hFdclPoawsnvqtdeam1WZDL/qrGfxo0LutY3t4vFE98la5lx8YvhGfHjZ121Dd8eyp+TK1zGTVwtayK6lPFQy32OgHv0Cx1NesAv2pHtu7+QRkjgcA5dv654FSHKF/YWT3RQM0ZdIFXxpkDuHV8zSA== 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:ErrorRetry; CAT:NONE; SFS:(13230022)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199015)(36840700001)(46966006)(6916009)(316002)(2616005)(83380400001)(478600001)(5660300002)(41300700001)(36756003)(82310400005)(70206006)(8936002)(70586007)(2906002)(36860700001)(356005)(47076005)(107886003)(4326008)(26005)(6666004)(8676002)(426003)(16526019)(1076003)(86362001)(336012)(7696005)(186003)(82740400003)(81166007)(40480700001)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:27:07.0976 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 582cdbf3-4ccd-43b1-c7cc-08da9d4e2a70 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: AM5EUR02FT062.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB8054 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..c3bdd4710897 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 = NULL; + 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 10:27: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: 609201 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 BDDFEECAAD8 for ; Fri, 23 Sep 2022 10:28:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231184AbiIWK1o (ORCPT ); Fri, 23 Sep 2022 06:27:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231402AbiIWK1Z (ORCPT ); Fri, 23 Sep 2022 06:27:25 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60130.outbound.protection.outlook.com [40.107.6.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D211128883 for ; Fri, 23 Sep 2022 03:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nR183U3JbKh9iUkGdGxIGlFmkP0kB84hdI9Ts9Yy16em3XgE+tPC4DCHbSJd4FNQ0D29+9ck5RIymLPIRGdHZctHBO/Po/T/enL8y2WMjoeTCIT7QAHL0p4ARIlz7m7zzToGJCdUfUMBLwTKkXg4KtEKxoc+BRf8PpOdg0/FF8r7OeVA3xz6qwBef5cpT42mqUMwCkgEu7PlS+c8B5M08NPB195nfvGjN/RrHlmcH6zu9evDBDzATwov1vtWwX1fofJUzI14X3ulGt7ZXi4ZB4UMaMBOWlJXo8Q80uRQfD+uOLVnjIK+sz4LBsc5puEYZaV4Ayrhjd813oA2krWojQ== 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=Kh3FhWIeu072AZXxBYJoGmmDn+MfbVraI9DIablLIjGNjHD4vzDdJ5b7S6NDVatxFKpVgjm1ZUtxJcYV+fgnpFHjWGyZAXzuLXLquEgIy1e8VOyZk6zn054gBOaAt1Z3k7P/kqcUcfvg8YbUaZDSRcOhOX+pYqBiqM5Q3OWP18oVlj5hn5nudLPijN9sLZCARWVoZ16Lp76JQXvWAguktA9egAt1icI3qfpcPc4WRYDAGREjQtHzSOOagIJt5PadJCVU68vL8FApxgMdoAH+SbAtjob0JR7nhX/pTmolQJOgVyqn7FD1T3jdsNDP+qtXTZqa5uLWcBEZCo5bcUiofg== 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=Ie3Qla+dmctzImL6GLnqXiWvmWfUbIKe7426OF8bum+KpD6chSWuAw/iWs66WlSK1rdzdFEZ/ieSOsHVuKY5EDfwdKwXA1cLoCwH45+vc3YLOIh2Ujthy8XJAm7r6QPA919evBXntPK/lsxKOT45KcBdxv13Nh3TyE0TnxZKtSw= Received: from AM6PR01CA0062.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::39) by PA4PR07MB8696.eurprd07.prod.outlook.com (2603:10a6:102:265::12) 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 10:27:21 +0000 Received: from AM5EUR02FT037.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::3d) by AM6PR01CA0062.outlook.office365.com (2603:10a6:20b:e0::39) 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 10:27:21 +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 AM5EUR02FT037.mail.protection.outlook.com (10.152.8.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.19 via Frontend Transport; Fri, 23 Sep 2022 10:27:21 +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 12:27:20 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 8/9] gatt: proxy_property_changed: check for NULL iterator Date: Fri, 23 Sep 2022 12:27:12 +0200 Message-ID: <20220923102712.10604-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: AM5EUR02FT037:EE_|PA4PR07MB8696:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d044dd1-8db3-446f-39e7-08da9d4e32fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dJucAEJgqp6vXkEKcOpTYjrWUgyYGVOZeZT3QtIM8nOjm/RFWQOAswr7my7EWItyK3qISNtXslZ9GNcmtUoMqQLCj86+bRdt4Leo8ffIFzgeAX1/z+X3g7ItUnNW7cOwfrCFCn03oqUUtG0evQGJ3RjJ6FrGu9CipfEM087E3x/z4VMKFoX7HdFTyf+kK2oLcOysAH+r6qU6w435eBWzxYdA/5l+URtx8VoURKLFAbf97msTgiJta9PV91ZLrcl/0z+dR+iHasWoB9z3WjYe0u+CKQDy8VGd8lLmrH9vjDoKFIntB/yvVsN/biLv4VGfIg/OqeaRivOLOnaJLx9VhGh6c5HaR4By8BIXFz0hUZnos4ku2iOW0Xefsq2+CxJGlEX5rYgyK7F7EIXwiNkcUSbAaUm2BPxFhcaBejeG6RlRnFHub7tYPsSfgv5gEnjuvgb9ldgoQEJP1rnz+0AOP0Ocy7TO3uig0wlvIh9wI8qHAgHIzvd4JIE7HxfgV5HHN1B6BIZebhi7YPYfLA4ORrcHKR3TFto2W99KYJQUyX/YNiPYiZRL2TZyuGQ4L25tuHXFDWAophJ7VjzjmXFp4G7eIYAse8FgNiCTE3XEvIyHpeP/zUAOTukOuT3utZTu3sv/8N28k1YtJvx1ibij93DOby9MIwlCzxxXBCIVM3lwwSktYYe5fmj4Kp18HWyuVcMAGAlJX19xynpvwQKPpK0FHVL5LgTMAjBDiz65YCruS8vPwG31b2yB7HfmvGMfd22AxMFJRskC/0yGtdPhlQ== 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)(39860400002)(346002)(396003)(376002)(451199015)(36840700001)(46966006)(82740400003)(36756003)(356005)(86362001)(83380400001)(81166007)(36860700001)(26005)(2906002)(40480700001)(6666004)(2616005)(6916009)(107886003)(336012)(7696005)(16526019)(478600001)(1076003)(426003)(186003)(47076005)(70206006)(8936002)(4326008)(316002)(82310400005)(70586007)(8676002)(41300700001)(5660300002)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:27:21.4242 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d044dd1-8db3-446f-39e7-08da9d4e32fb 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: AM5EUR02FT037.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB8696 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 10:27:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 608668 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 4C95FECAAD8 for ; Fri, 23 Sep 2022 10:28:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbiIWK2K (ORCPT ); Fri, 23 Sep 2022 06:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230356AbiIWK1j (ORCPT ); Fri, 23 Sep 2022 06:27:39 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2090.outbound.protection.outlook.com [40.107.20.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 271D9127572 for ; Fri, 23 Sep 2022 03:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hyJotGus/iyhQDfoi0wN73mV2E2sGbFO/LP4a0p5MmkUS9JwwOLJQq97z2z1/oqZFI085MhGSUFRKpX7njuotp3xmRLDyZBfBLsWoMKD7CCZHz++lBUcIZZleh4Lc6QRhGbn1baICn2mCI7XaoErhnU+7TaoWkDW9/1PRqABwLZ59APk/fFHu8Jtu0dnDL2Pw7ai+426y8mQk7gwyTWR/T2+J/dzviFbbBbcU+zl8pRpibhBHfLQxG2tjCN7HjBtMdssWs7vZ5Cro3YMe4nPMDeroNPWF+As9I2dTZhwOjwlDsRU9IRhrZmN1zE9IRObm1V+WRMr3Tef8B7uCaB3uQ== 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=VraHaar6ctwokIPtzNGEDCsWVfHZtb2Sjby5GCi4OFZPIzSb4C/ogLWacfAmRD0VXSXrqLJfqbt2+oZeONIJjLNnYXNU7nYnth/brI6RfXpIudf+lG6S8+Vg4SxFNZLNs9LGiOvqhaY099bHwJE+27Wcp3iS+Ju12m2cJs8OA6sKUAawbglVBfm4JJUsGCfwI4hnwYp8mT0ujaZ4TDnv1G06tgA1YAyWbnsLTQMis2UbyuxmCyGlIkDAd0bsHNQHRFdjdv+wU1csY8OgAoW9ZA7SoGgKwXO5zioPRmLMvAvRcJHgSxsuj8yD99xwr5IBf+vUIBCWNTDsrpKd1nfIVA== 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=Yh3wi+6rAO0icTuW24bFEENiYbcN75kn4L9L0xjLgktY3/4/ss2hKmMV1W6U/jFXu00h494VxdKSNHUwJgtEjZepMRZKO5jgEk6jKsAfKvn0PA5frqUHyjAWqKOrjqbVetzf6R/9hG4Xi1+pJwA9ReQuCT5kHBIx/rrirUwyKug= Received: from AM7PR04CA0029.eurprd04.prod.outlook.com (2603:10a6:20b:110::39) by AM7PR07MB6423.eurprd07.prod.outlook.com (2603:10a6:20b:132::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.8; Fri, 23 Sep 2022 10:27:36 +0000 Received: from AM5EUR02FT013.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:110:cafe::6) by AM7PR04CA0029.outlook.office365.com (2603:10a6:20b:110::39) 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 10:27:35 +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 AM5EUR02FT013.mail.protection.outlook.com (10.152.8.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.19 via Frontend Transport; Fri, 23 Sep 2022 10:27:35 +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 12:27:34 +0200 From: Christian Eggers To: CC: Christian Eggers Subject: [PATCH BlueZ 9/9] battery: provided_battery_property_changed_cb: check for NULL iterator Date: Fri, 23 Sep 2022 12:27:27 +0200 Message-ID: <20220923102727.10636-1-ceggers@arri.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220923102421.10336-1-ceggers@arri.de> References: <20220923102421.10336-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: AM5EUR02FT013:EE_|AM7PR07MB6423:EE_ X-MS-Office365-Filtering-Correlation-Id: 54ad98f7-e45c-4e17-7c3b-08da9d4e3b21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2K6hNs4Ir8WLEMYSIRkn9bN9lNgxkLccCKNPwoqIUstL/WGcDcWIUCXUeyaWtVCullDUU9ZBI7HEHzGBANnDCN4hnUeHS54Oqvv3m2B1VSRrBC8L7nQtRtJ7wBfD/foEPsAD5liJymzTYnHSioRPMH16tyvCxLx2FOTFk6ZJqJx6pUryKDAIeFGFJzNKvqM5dhImInqB3mjv3HcpgepnaK8oJwxujexBVFl0AjU6RScQK+ZcOkWMaSJlbhglt1YcIF/fY0s+4/TIGsGSojy/ipS7nwoogk42AWgwjOlmvaBKV7CRrPnmQ9XdxtpXlLKuHQL3cI3eu0ZEFqrZYryv0EFUJ/O48fIX40I8nZR1YmoIOUBb5GGBgOgxz5uD/XSfWnLVYYZdGzoWRUWpE3APy87iMWG2IhehFfqyRpmcccmu6ATJai7VT+ELU20ll0i2WFsm4heeIGVX5QezZqik9esjpBlV2Q8cjC12p9wRajz6lwZIQF5Hyu5nnMTzHxWx7jfZR4SYSolN/KExsMc4Spzhhd7HTlqRStrKkc9toajo1GAozp4a7eMq/pPdipnAX99YV0yCYN0kCPjU2Im90EunO0v5d5kF6LEZQ0GSWPpVgs8fsITbTFJKB3kcSCtyp8B6si9oewc3ajE9ue8uUEc8qteewtzaW8oObgOaWhvMLdWmNHNpkXdUGwFJAkk9Wmqr17Vz8IqnMyqMfpSfxbrQExJZh0vJLYWHhl0JUEGB11Mmt2f9ApWB8W7d/HysYfEpyRK8hMAq1d16XToR/g== 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)(346002)(39850400004)(376002)(396003)(451199015)(36840700001)(46966006)(82310400005)(70586007)(70206006)(4326008)(26005)(7696005)(83380400001)(426003)(336012)(356005)(86362001)(107886003)(8676002)(36860700001)(41300700001)(40480700001)(5660300002)(6666004)(8936002)(36756003)(6916009)(316002)(81166007)(2616005)(47076005)(2906002)(16526019)(186003)(1076003)(478600001)(82740400003)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: arri.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:27:35.0917 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 54ad98f7-e45c-4e17-7c3b-08da9d4e3b21 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: AM5EUR02FT013.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR07MB6423 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);