p2putil: Tolerate GO Neg Response with empty Channel List

Work around a parse error in GO Negotiation with some P2P devices.
This commit is contained in:
Andrew Zaborowski 2020-03-18 15:45:31 +01:00 committed by Denis Kenzior
parent 22d7a3c629
commit 66657a5706
1 changed files with 6 additions and 1 deletions

View File

@ -193,7 +193,12 @@ static bool extract_p2p_channel_list(const uint8_t *attr, size_t len,
{
struct p2p_channel_list_attr *out = data;
if (len < 6)
/*
* Some devices reply with an empty Channel Entry List inside the
* Channel List attribute of a GO Negotiation Response (status 1),
* so tolerate a length of 3.
*/
if (len < 3)
return false;
out->country[0] = *attr++;