mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-29 15:14:31 +08:00
AVRCP: Check if len matches number of IDs
If number of attributes remote side provided is larger than the length we read, we would read garbage from stack memory.
This commit is contained in:
parent
28b3057757
commit
7cddeb379d
@ -597,12 +597,16 @@ static uint8_t avrcp_handle_get_element_attributes(struct avrcp_player *player,
|
||||
int size;
|
||||
unsigned int i;
|
||||
|
||||
if (len < 8 || *identifier != 0)
|
||||
if (len < 9 || *identifier != 0)
|
||||
goto err;
|
||||
|
||||
nattr = pdu->params[8];
|
||||
|
||||
if (len < nattr * sizeof(uint32_t) + 1)
|
||||
goto err;
|
||||
|
||||
len = 0;
|
||||
pos = 1; /* Keep track of current position in reponse */
|
||||
nattr = pdu->params[8];
|
||||
|
||||
if (!nattr) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user