gatt-server: Check pointer before memcpy
authorIulia Tanasescu <iulia.tanasescu@nxp.com>
Tue, 13 Jun 2023 14:16:24 +0000 (17:16 +0300)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
commit7f13044df170476dd124908ba1bef32c636cd7c8
tree446c921c2d769ebd7fa68ad9ab26e123c5de8f7c
parent686d585d6503d57da51a9ee5de1ac96c0de58f4f
gatt-server: Check pointer before memcpy

This adds a check before calling memcpy inside
bt_gatt_server_send_notification, to avoid getting
the following error in case the user wants to send
an empty notification for an attribute:

src/shared/gatt-server.c:1789:3: runtime error:
null pointer passed as argument 2, which is declared to never be null
src/shared/gatt-server.c