Skip to content
Commit a3cbf8e2 authored by Ivan Iushkov's avatar Ivan Iushkov Committed by Fabio Baltieri
Browse files

Bluetooth: fixing null-pointer dereference in l2cap channel destroyer



During local testing with UBSAN enabled, warning was reported:
bluetooth/host/l2cap.c:980:25: runtime error: member access
within null pointer of type 'struct k_work_q'

It turned out that le_chan->rtx_work.queue can be NULL.
Since null-pointer dereference is a UB, additional check
was added to ensure we don't access
`le_chan->rtx_work.queue->thread` when
`le_chan->rtx_work.queue == NULL`

The same changes applied to l2cap_br.c

Signed-off-by: default avatarIvan Iushkov <ivan.iushkov@nordicsemi.no>
parent e8d09001
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment