Skip to content
Snippets Groups Projects
Commit 0d9058e1 authored by Ted Wang's avatar Ted Wang Committed by Automerger Merge Worker
Browse files

Merge "Add length check when copy AVDTP packet" into tm-dev am: 851a2d15

parents ea8479df 851a2d15
No related branches found
No related tags found
No related merge requests found
......@@ -1252,6 +1252,10 @@ BT_HDR* avdt_msg_asmbl(AvdtpCcb* p_ccb, BT_HDR* p_buf) {
* would have allocated smaller buffer.
*/
p_ccb->p_rx_msg = (BT_HDR*)osi_malloc(BT_DEFAULT_BUFFER_SIZE);
if (sizeof(BT_HDR) + p_buf->offset + p_buf->len > BT_DEFAULT_BUFFER_SIZE) {
android_errorWriteLog(0x534e4554, "232023771");
return NULL;
}
memcpy(p_ccb->p_rx_msg, p_buf, sizeof(BT_HDR) + p_buf->offset + p_buf->len);
/* Free original buffer */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment