Commit: dacc693732634365251328159d44d1dc42bd37c5
Parent: c85546cba715afee020e61bd0a44499e618d0371
Author: Frédéric Danis <frederic.danis@collabora.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-01-12 17:21:15
Tree: eaaa7a8bc67b8fa76ad1ed745afd193623c83b25

shared/gatt-db: Fix munmap_chunk invalid pointer PTS test GATT/CL/GAD/BV-03-C published a service starting at handle 0xfffd and ending at 0xffff. This resets the next_handle to 0 in gatt_db_insert_service() instead of setting it to 0x10000. Other services are added later. This could end-up by a crash in db_hash_update() if not enough space has been allocated for hash.iov and some entries are overwritten. Next_handle can be replaced by a last_handle variable which will not loop over. This can be replaced by queue_peek_tail() and computing the value, but keeping last_handle will avoid this sort of lookup.

Diffstat

M src/shared/gatt-db.c | 19 ++++++++++- - - - - - - - -

1 files changed, 10 insertions(+), 9 deletions(-)

View Full Diff | Patch