Commit 2ef9e28
[nrf fromtree] Bluetooth: fixing UBSAN warnings related to Codec Configuration
During local testing with UBSAN enabled, warning was reported:
bluetooth/host/iso.c:237:2: runtime error: null pointer passed
as argument 2, which is declared to never be null
It turned out that when datapath doesn't contain
codec information, cc_len is 0 and cc is NULL
In order to avoid UB,
now we call memcpy only when cp->codec_config_len > 0
Signed-off-by: Ivan Iushkov <[email protected]>
(cherry picked from commit e8d0900)
Signed-off-by: Ivan Iushkov <[email protected]>1 parent 4c9479b commit 2ef9e28
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
238 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| |||
0 commit comments