Message ID | 20250221163139.1705-2-sarveshwar.bajaj@nxp.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | shared/gatt-db: Fix incorrect attribute type | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/BuildEll | success | Build ELL PASS |
tedd_an/BluezMake | success | Bluez Make PASS |
tedd_an/MakeCheck | success | Bluez Make Check PASS |
tedd_an/MakeDistcheck | success | Make Distcheck PASS |
tedd_an/CheckValgrind | success | Check Valgrind PASS |
tedd_an/CheckSmatch | success | CheckSparse PASS |
tedd_an/bluezmakeextell | success | Make External ELL PASS |
tedd_an/ScanBuild | success | Scan Build PASS |
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=936519 ---Test result--- Test Summary: CheckPatch PENDING 0.22 seconds GitLint PENDING 0.22 seconds BuildEll PASS 20.67 seconds BluezMake PASS 1602.50 seconds MakeCheck PASS 13.61 seconds MakeDistcheck PASS 158.11 seconds CheckValgrind PASS 214.47 seconds CheckSmatch PASS 284.87 seconds bluezmakeextell PASS 99.24 seconds IncrementalBuild PENDING 0.29 seconds ScanBuild PASS 884.86 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth
diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c index fe272de34..b44140523 100644 --- a/src/shared/gatt-db.c +++ b/src/shared/gatt-db.c @@ -379,6 +379,9 @@ static void gen_hash_m(struct gatt_db_attribute *attr, void *user_data) uint8_t *data; size_t len; + if (!attr || !attr->value) + return; + if (bt_uuid_len(&attr->uuid) != 2) return; @@ -1005,6 +1008,10 @@ service_insert_characteristic(struct gatt_db_service *service, /* Update handle of characteristic value_handle if it has changed */ put_le16(value_handle, &value[1]); + + if (!(*chrc) || !(*chrc)->value) + return NULL; + if (memcmp((*chrc)->value, value, len)) memcpy((*chrc)->value, value, len); @@ -1229,6 +1236,9 @@ service_insert_included(struct gatt_db_service *service, uint16_t handle, uint16_t included_handle, len = 0; int index; + if (!include || !include->value || !include->service || !service) + return NULL; + included = include->service; /* Adjust include to point to the first attribute */ @@ -1386,6 +1396,9 @@ static void find_by_type(struct gatt_db_attribute *attribute, void *user_data) if (search_data->value_len != attribute->value_len) return; + if (!attribute || !attribute->value) + return; + if (memcmp(attribute->value, search_data->value, search_data->value_len)) return;