* [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator @ 2022-09-23 14:55 Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (7 more replies) 0 siblings, 8 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:55 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers v2: ---- - 7/9: don't call memcpy(x, NULL, 0) [Scan Build] - 9/9: shorten GIT summary [GitLint] Christian Eggers (9): advertising: parse_secondary: fix loop condition advertising: parse_secondary: fix mask value advertising: parse_secondary: check for NULL iterator advertising: parse_min_interval: reset min_interval if iter is NULL advertising: parse_[min|max]_interval: reset value if iter is NULL advertising: parse_tx_power: reset value if iter is NULL client/gatt: proxy_property_changed: check for NULL iterator gatt: proxy_property_changed: check for NULL iterator battery: provided_battery_property_changed_cb: check iterator client/gatt.c | 17 ++++++++++------- src/advertising.c | 22 +++++++++++++++++----- src/battery.c | 10 ++++++---- src/gatt-database.c | 20 +++++++++++--------- 4 files changed, 44 insertions(+), 25 deletions(-) -- 2.35.3 ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers @ 2022-09-23 14:55 ` Christian Eggers 2022-09-23 15:47 ` properties_changed: check for NULL iterator bluez.test.bot ` (14 more replies) 2022-09-23 14:55 ` [PATCH BlueZ v2 2/9] advertising: parse_secondary: fix mask value Christian Eggers ` (6 subsequent siblings) 7 siblings, 15 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:55 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers "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; -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers @ 2022-09-23 15:47 ` bluez.test.bot 2022-09-29 16:49 ` bluez.test.bot ` (13 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-23 15:47 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 1368 bytes --] This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=679920 ---Test result--- Test Summary: CheckPatch PASS 4.24 seconds GitLint FAIL 2.93 seconds Prep - Setup ELL PASS 31.70 seconds Build - Prep PASS 0.62 seconds Build - Configure PASS 7.06 seconds Build - Make PASS 884.89 seconds Make Check PASS 11.33 seconds Make Check w/Valgrind PASS 344.83 seconds Make Distcheck PASS 211.00 seconds Build w/ext ELL - Configure PASS 7.14 seconds Build w/ext ELL - Make PASS 116.89 seconds Incremental Build w/ patches PASS 533.39 seconds Scan Build PASS 715.27 seconds Details ############################## Test: GitLint - FAIL Desc: Run gitlint with rule in .gitlint Output: [BlueZ,v2,4/9] advertising: parse_min_interval: reset min_interval if iter is NULL 1: T1 Title exceeds max length (82>80): "[BlueZ,v2,4/9] advertising: parse_min_interval: reset min_interval if iter is NULL" --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers 2022-09-23 15:47 ` properties_changed: check for NULL iterator bluez.test.bot @ 2022-09-29 16:49 ` bluez.test.bot 2022-09-29 17:45 ` bluez.test.bot ` (12 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 16:49 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers 2022-09-23 15:47 ` properties_changed: check for NULL iterator bluez.test.bot 2022-09-29 16:49 ` bluez.test.bot @ 2022-09-29 17:45 ` bluez.test.bot 2022-09-29 18:40 ` bluez.test.bot ` (11 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 17:45 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (2 preceding siblings ...) 2022-09-29 17:45 ` bluez.test.bot @ 2022-09-29 18:40 ` bluez.test.bot 2022-09-29 19:01 ` bluez.test.bot ` (10 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 18:40 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (3 preceding siblings ...) 2022-09-29 18:40 ` bluez.test.bot @ 2022-09-29 19:01 ` bluez.test.bot 2022-09-29 19:29 ` bluez.test.bot ` (9 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 19:01 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (4 preceding siblings ...) 2022-09-29 19:01 ` bluez.test.bot @ 2022-09-29 19:29 ` bluez.test.bot 2022-09-29 19:47 ` bluez.test.bot ` (8 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 19:29 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (5 preceding siblings ...) 2022-09-29 19:29 ` bluez.test.bot @ 2022-09-29 19:47 ` bluez.test.bot 2022-09-29 20:34 ` bluez.test.bot ` (7 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 19:47 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (6 preceding siblings ...) 2022-09-29 19:47 ` bluez.test.bot @ 2022-09-29 20:34 ` bluez.test.bot 2022-09-29 20:53 ` bluez.test.bot ` (6 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 20:34 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (7 preceding siblings ...) 2022-09-29 20:34 ` bluez.test.bot @ 2022-09-29 20:53 ` bluez.test.bot 2022-09-29 21:30 ` bluez.test.bot ` (5 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 20:53 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (8 preceding siblings ...) 2022-09-29 20:53 ` bluez.test.bot @ 2022-09-29 21:30 ` bluez.test.bot 2022-09-29 21:52 ` bluez.test.bot ` (4 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 21:30 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (9 preceding siblings ...) 2022-09-29 21:30 ` bluez.test.bot @ 2022-09-29 21:52 ` bluez.test.bot 2022-09-29 22:32 ` bluez.test.bot ` (3 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 21:52 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (10 preceding siblings ...) 2022-09-29 21:52 ` bluez.test.bot @ 2022-09-29 22:32 ` bluez.test.bot 2022-09-29 22:52 ` bluez.test.bot ` (2 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 22:32 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (11 preceding siblings ...) 2022-09-29 22:32 ` bluez.test.bot @ 2022-09-29 22:52 ` bluez.test.bot 2022-09-29 23:40 ` bluez.test.bot 2022-09-29 23:59 ` bluez.test.bot 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 22:52 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (12 preceding siblings ...) 2022-09-29 22:52 ` bluez.test.bot @ 2022-09-29 23:40 ` bluez.test.bot 2022-09-29 23:59 ` bluez.test.bot 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 23:40 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: properties_changed: check for NULL iterator 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers ` (13 preceding siblings ...) 2022-09-29 23:40 ` bluez.test.bot @ 2022-09-29 23:59 ` bluez.test.bot 14 siblings, 0 replies; 27+ messages in thread From: bluez.test.bot @ 2022-09-29 23:59 UTC (permalink / raw) To: linux-bluetooth, ceggers [-- Attachment #1: Type: text/plain, Size: 537 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: src/advertising.c:1055 error: src/advertising.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 2/9] advertising: parse_secondary: fix mask value 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers @ 2022-09-23 14:55 ` Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 3/9] advertising: parse_secondary: check for NULL iterator Christian Eggers ` (5 subsequent siblings) 7 siblings, 0 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:55 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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); -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 3/9] advertising: parse_secondary: check for NULL iterator 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 2/9] advertising: parse_secondary: fix mask value Christian Eggers @ 2022-09-23 14:55 ` Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 4/9] advertising: parse_min_interval: reset min_interval if iter is NULL Christian Eggers ` (4 subsequent siblings) 7 siblings, 0 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:55 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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; -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 4/9] advertising: parse_min_interval: reset min_interval if iter is NULL 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers ` (2 preceding siblings ...) 2022-09-23 14:55 ` [PATCH BlueZ v2 3/9] advertising: parse_secondary: check for NULL iterator Christian Eggers @ 2022-09-23 14:55 ` Christian Eggers 2022-09-23 14:57 ` [PATCH BlueZ v2 5/9] advertising: parse_[min|max]_interval: reset value " Christian Eggers ` (3 subsequent siblings) 7 siblings, 0 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:55 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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; -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 5/9] advertising: parse_[min|max]_interval: reset value if iter is NULL 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers ` (3 preceding siblings ...) 2022-09-23 14:55 ` [PATCH BlueZ v2 4/9] advertising: parse_min_interval: reset min_interval if iter is NULL Christian Eggers @ 2022-09-23 14:57 ` Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 6/9] advertising: parse_tx_power: " Christian Eggers ` (2 subsequent siblings) 7 siblings, 0 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:57 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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; -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 6/9] advertising: parse_tx_power: reset value if iter is NULL 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers ` (4 preceding siblings ...) 2022-09-23 14:57 ` [PATCH BlueZ v2 5/9] advertising: parse_[min|max]_interval: reset value " Christian Eggers @ 2022-09-23 14:58 ` Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 7/9] client/gatt: proxy_property_changed: check for NULL iterator Christian Eggers ` (2 more replies) 2022-09-23 19:18 ` [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Luiz Augusto von Dentz 2022-09-23 20:50 ` patchwork-bot+bluetooth 7 siblings, 3 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:58 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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; -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 7/9] client/gatt: proxy_property_changed: check for NULL iterator 2022-09-23 14:58 ` [PATCH BlueZ v2 6/9] advertising: parse_tx_power: " Christian Eggers @ 2022-09-23 14:58 ` Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 8/9] gatt: " Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 9/9] battery: provided_battery_property_changed_cb: check iterator Christian Eggers 2 siblings, 0 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:58 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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); -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 8/9] gatt: proxy_property_changed: check for NULL iterator 2022-09-23 14:58 ` [PATCH BlueZ v2 6/9] advertising: parse_tx_power: " Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 7/9] client/gatt: proxy_property_changed: check for NULL iterator Christian Eggers @ 2022-09-23 14:58 ` Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 9/9] battery: provided_battery_property_changed_cb: check iterator Christian Eggers 2 siblings, 0 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:58 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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 */ -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH BlueZ v2 9/9] battery: provided_battery_property_changed_cb: check iterator 2022-09-23 14:58 ` [PATCH BlueZ v2 6/9] advertising: parse_tx_power: " Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 7/9] client/gatt: proxy_property_changed: check for NULL iterator Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 8/9] gatt: " Christian Eggers @ 2022-09-23 14:58 ` Christian Eggers 2 siblings, 0 replies; 27+ messages in thread From: Christian Eggers @ 2022-09-23 14:58 UTC (permalink / raw) To: linux-bluetooth; +Cc: Christian Eggers 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); -- 2.35.3 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers ` (5 preceding siblings ...) 2022-09-23 14:58 ` [PATCH BlueZ v2 6/9] advertising: parse_tx_power: " Christian Eggers @ 2022-09-23 19:18 ` Luiz Augusto von Dentz 2022-09-23 20:50 ` patchwork-bot+bluetooth 7 siblings, 0 replies; 27+ messages in thread From: Luiz Augusto von Dentz @ 2022-09-23 19:18 UTC (permalink / raw) To: Christian Eggers; +Cc: linux-bluetooth Hi Christian, On Fri, Sep 23, 2022 at 8:02 AM Christian Eggers <ceggers@arri.de> wrote: Perhaps you should rephrase to mention the NULL iter is actually the result of invalidate properties. > v2: > ---- > - 7/9: don't call memcpy(x, NULL, 0) [Scan Build] > - 9/9: shorten GIT summary [GitLint] > > Christian Eggers (9): > advertising: parse_secondary: fix loop condition > advertising: parse_secondary: fix mask value > advertising: parse_secondary: check for NULL iterator > advertising: parse_min_interval: reset min_interval if iter is NULL > advertising: parse_[min|max]_interval: reset value if iter is NULL > advertising: parse_tx_power: reset value if iter is NULL > client/gatt: proxy_property_changed: check for NULL iterator > gatt: proxy_property_changed: check for NULL iterator > battery: provided_battery_property_changed_cb: check iterator > > client/gatt.c | 17 ++++++++++------- > src/advertising.c | 22 +++++++++++++++++----- > src/battery.c | 10 ++++++---- > src/gatt-database.c | 20 +++++++++++--------- > 4 files changed, 44 insertions(+), 25 deletions(-) > > -- > 2.35.3 > -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers ` (6 preceding siblings ...) 2022-09-23 19:18 ` [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Luiz Augusto von Dentz @ 2022-09-23 20:50 ` patchwork-bot+bluetooth 7 siblings, 0 replies; 27+ messages in thread From: patchwork-bot+bluetooth @ 2022-09-23 20:50 UTC (permalink / raw) To: Christian Eggers; +Cc: linux-bluetooth Hello: This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Fri, 23 Sep 2022 16:55:53 +0200 you wrote: > v2: > ---- > - 7/9: don't call memcpy(x, NULL, 0) [Scan Build] > - 9/9: shorten GIT summary [GitLint] > > Christian Eggers (9): > advertising: parse_secondary: fix loop condition > advertising: parse_secondary: fix mask value > advertising: parse_secondary: check for NULL iterator > advertising: parse_min_interval: reset min_interval if iter is NULL > advertising: parse_[min|max]_interval: reset value if iter is NULL > advertising: parse_tx_power: reset value if iter is NULL > client/gatt: proxy_property_changed: check for NULL iterator > gatt: proxy_property_changed: check for NULL iterator > battery: provided_battery_property_changed_cb: check iterator > > [...] Here is the summary with links: - [BlueZ,v2,1/9] advertising: parse_secondary: fix loop condition https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=47821c473102 - [BlueZ,v2,2/9] advertising: parse_secondary: fix mask value https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2e4327816587 - [BlueZ,v2,3/9] advertising: parse_secondary: check for NULL iterator https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=732eaa7ccf85 - [BlueZ,v2,4/9] advertising: parse_min_interval: reset min_interval if iter is NULL https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=abfb3a807c39 - [BlueZ,v2,5/9] advertising: parse_[min|max]_interval: reset value if iter is NULL https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a18d66862da1 - [BlueZ,v2,6/9] advertising: parse_tx_power: reset value if iter is NULL https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=47346e5390bb - [BlueZ,v2,7/9] client/gatt: proxy_property_changed: check for NULL iterator (no matching commit) - [BlueZ,v2,8/9] gatt: proxy_property_changed: check for NULL iterator https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f5cbe08af22e - [BlueZ,v2,9/9] battery: provided_battery_property_changed_cb: check iterator https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=15895e401e1e You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2022-09-30 0:00 UTC | newest] Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-09-23 14:55 [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 1/9] advertising: parse_secondary: fix loop condition Christian Eggers 2022-09-23 15:47 ` properties_changed: check for NULL iterator bluez.test.bot 2022-09-29 16:49 ` bluez.test.bot 2022-09-29 17:45 ` bluez.test.bot 2022-09-29 18:40 ` bluez.test.bot 2022-09-29 19:01 ` bluez.test.bot 2022-09-29 19:29 ` bluez.test.bot 2022-09-29 19:47 ` bluez.test.bot 2022-09-29 20:34 ` bluez.test.bot 2022-09-29 20:53 ` bluez.test.bot 2022-09-29 21:30 ` bluez.test.bot 2022-09-29 21:52 ` bluez.test.bot 2022-09-29 22:32 ` bluez.test.bot 2022-09-29 22:52 ` bluez.test.bot 2022-09-29 23:40 ` bluez.test.bot 2022-09-29 23:59 ` bluez.test.bot 2022-09-23 14:55 ` [PATCH BlueZ v2 2/9] advertising: parse_secondary: fix mask value Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 3/9] advertising: parse_secondary: check for NULL iterator Christian Eggers 2022-09-23 14:55 ` [PATCH BlueZ v2 4/9] advertising: parse_min_interval: reset min_interval if iter is NULL Christian Eggers 2022-09-23 14:57 ` [PATCH BlueZ v2 5/9] advertising: parse_[min|max]_interval: reset value " Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 6/9] advertising: parse_tx_power: " Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 7/9] client/gatt: proxy_property_changed: check for NULL iterator Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 8/9] gatt: " Christian Eggers 2022-09-23 14:58 ` [PATCH BlueZ v2 9/9] battery: provided_battery_property_changed_cb: check iterator Christian Eggers 2022-09-23 19:18 ` [PATCH BlueZ v2 0/9] properties_changed: check for NULL iterator Luiz Augusto von Dentz 2022-09-23 20:50 ` patchwork-bot+bluetooth
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.