mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(bt/bluedroid): fixed the vulerabilities from AI code review in SPP
This commit is contained in:
@@ -121,6 +121,10 @@ BOOLEAN rfc_check_fcs (UINT16 len, UINT8 *p, UINT8 received_fcs)
|
||||
return (fcs == 0xCF);
|
||||
}
|
||||
|
||||
void osi_free_fun(void *p)
|
||||
{
|
||||
osi_free(p);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -168,7 +172,7 @@ tRFC_MCB *rfc_alloc_multiplexer_channel (BD_ADDR bd_addr, BOOLEAN is_initiator)
|
||||
p_mcb = &rfc_cb.port.rfc_mcb[j];
|
||||
if (rfc_cb.port.rfc_mcb[j].state == RFC_MX_STATE_IDLE) {
|
||||
/* New multiplexer control block */
|
||||
fixed_queue_free(p_mcb->cmd_q, NULL);
|
||||
fixed_queue_free(p_mcb->cmd_q, osi_free_fun);
|
||||
rfc_timer_free(p_mcb);
|
||||
memset (p_mcb, 0, sizeof (tRFC_MCB));
|
||||
memcpy (p_mcb->bd_addr, bd_addr, BD_ADDR_LEN);
|
||||
@@ -188,15 +192,11 @@ tRFC_MCB *rfc_alloc_multiplexer_channel (BD_ADDR bd_addr, BOOLEAN is_initiator)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
void osi_free_fun(void *p)
|
||||
{
|
||||
osi_free(p);
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function rfc_release_multiplexer_channel
|
||||
**
|
||||
** Description This function returns existing or new control block for
|
||||
** Description This function releases existing control block for
|
||||
** the BD_ADDR.
|
||||
**
|
||||
*******************************************************************************/
|
||||
@@ -299,7 +299,7 @@ void rfc_port_timer_stop (tPORT *p_port)
|
||||
*******************************************************************************/
|
||||
void rfc_port_timer_free (tPORT *p_port)
|
||||
{
|
||||
RFCOMM_TRACE_EVENT ("rfc_port_timer_stop");
|
||||
RFCOMM_TRACE_EVENT ("rfc_port_timer_free");
|
||||
|
||||
btu_free_timer (&p_port->rfc.tle);
|
||||
memset(&p_port->rfc.tle, 0, sizeof(TIMER_LIST_ENT));
|
||||
|
||||
Reference in New Issue
Block a user