You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/09/22 08:11:58 UTC

[GitHub] andrzej-kaczmarek commented on a change in pull request #193: nimble/host: Improve BLE uuid comparison, handle invalid uuid's

andrzej-kaczmarek commented on a change in pull request #193: nimble/host: Improve BLE uuid comparison, handle invalid uuid's
URL: https://github.com/apache/mynewt-nimble/pull/193#discussion_r219664831
 
 

 ##########
 File path: nimble/host/src/ble_gattc.c
 ##########
 @@ -2453,7 +2453,8 @@ ble_gattc_disc_chr_uuid_rx_adata(struct ble_gattc_proc *proc,
     if (rc != 0) {
         /* Failure. */
         cbrc = ble_gattc_disc_chr_uuid_cb(proc, rc, 0, NULL);
-    } else if (ble_uuid_cmp(&chr.uuid.u, &proc->disc_chr_uuid.chr_uuid.u) == 0) {
+    } else if (ble_uuid_check(&chr.uuid.u) == 0 &&
+               ble_uuid_cmp(&chr.uuid.u, &proc->disc_chr_uuid.chr_uuid.u) == 0) {
 
 Review comment:
   What does it mean 'malformed UUID' in this case? UUID received over the air is checked earlier so malformed UUID should be already rejected. One thing that `ble_uuid_init_from_buf` does not check is whether 16-bit UUID was not transferred as 128-bit UUID over the air which is incorrect and this is what should be fixed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services