summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-12-02 16:04:43 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-12-02 16:06:10 -0800
commit35947e26771c89d965aec5ad059267bb8c15298e (patch)
treecde98e67b4884ed430759788d0437fc951f02c07 /monitor
parentd84ce72a543e090665a33ecac64b604805d2ec4c (diff)
downloadbluez-35947e26771c89d965aec5ad059267bb8c15298e.tar.gz
monitor/att: Fix crash when accessing packet_conn
This fixes the following crash: :monitor/att.c:2697:11: runtime error: member access within null pointer of type 'struct att_conn_data'
Diffstat (limited to 'monitor')
-rw-r--r--monitor/att.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/monitor/att.c b/monitor/att.c
index d14cbd165..170b5d875 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -2576,7 +2576,12 @@ static void att_conn_data_free(void *data)
static struct att_conn_data *att_get_conn_data(struct packet_conn_data *conn)
{
- struct att_conn_data *data = conn->data;
+ struct att_conn_data *data;
+
+ if (!conn)
+ return NULL;
+
+ data = conn->data;
if (data)
return data;
@@ -2610,6 +2615,8 @@ static void att_read_type_req(const struct l2cap_frame *frame)
conn = packet_get_conn_data(frame->handle);
data = att_get_conn_data(conn);
+ if (!data)
+ return;
if (!data->reads)
data->reads = queue_new();