mtu_update/peripheral can crash if the connection context is NULL #88856
Labels
area: Bluetooth
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
when the application tries to get the Attribute Maximum Transmission Unit when the peripheral is in not connected
The following function gets called:
bt_gatt_get_uatt_mtu(default_conn)
< -- The default connection will be NULLThe above function calls
bt_att_get_uatt_mtu(conn)
Which in turn calls
att = att_get(conn);
att_get tries to access conn context without NULL check. Hence we end up in crash.
To Reproduce
Expected behavior
We can fix this by introducing a NULL check in the application:
We may also have to introduce a NULL check in
att_get
to avoid this problemImpact
Logs and console output
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: