diff options
author | CNSS_WLAN Service <cnssbldsw@qualcomm.com> | 2023-04-20 04:11:43 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2023-04-20 04:11:43 -0700 |
commit | 06f9f713de0a6c7f034601b8c70f3e11a48055ae (patch) | |
tree | f3763702f9cc59f79c2555cafa57b7fd7137fb4d | |
parent | 3566fd5cd55f1a6eed81d3bcca10bcb4b3458203 (diff) | |
parent | 10e698993701b45da91dd767499523273e90f1fe (diff) |
Merge "The current implementation uses `pad_len = *(p_start + len);` to read the last byte from the packet, resulting one-byte out-of-bound read." into bt-sys.lnx.13.0
-rw-r--r-- | stack/avdt/avdt_scb_act.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stack/avdt/avdt_scb_act.cc b/stack/avdt/avdt_scb_act.cc index fc354068a..9606f5383 100644 --- a/stack/avdt/avdt_scb_act.cc +++ b/stack/avdt/avdt_scb_act.cc @@ -282,7 +282,7 @@ void avdt_scb_hdl_pkt_no_frag(tAVDT_SCB* p_scb, tAVDT_SCB_EVT* p_data) { p += ex_len * 4; } - if ((p - p_start) > len) { + if ((p - p_start) >= len) { android_errorWriteLog(0x534e4554, "142546355"); osi_free_and_reset((void**)&p_data->p_pkt); return; @@ -292,11 +292,11 @@ void avdt_scb_hdl_pkt_no_frag(tAVDT_SCB* p_scb, tAVDT_SCB_EVT* p_data) { /* adjust length for any padding at end of packet */ if (o_p) { /* padding length in last byte of packet */ - pad_len = *(p_start + len); + pad_len = *(p_start + len - 1); } /* do sanity check */ - if (pad_len > (len - offset)) { + if (pad_len >= (len - offset)) { AVDT_TRACE_WARNING("Got bad media packet"); osi_free_and_reset((void**)&p_data->p_pkt); } |