aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Zaborowski <andrew.zaborowski@intel.com>2020-03-18 15:45:31 +0100
committerDenis Kenzior <denkenz@gmail.com>2020-03-18 13:50:32 -0500
commit66657a57069225fb05ede9a5fd61736862c2a997 (patch)
tree7c81a8a77ad12558c3af3947b05efb30115dd0cd
parent22d7a3c629e00aa7c6ecfa965d09c068eb0c17b0 (diff)
downloadiwd-66657a57069225fb05ede9a5fd61736862c2a997.tar.gz
p2putil: Tolerate GO Neg Response with empty Channel List
Work around a parse error in GO Negotiation with some P2P devices.
-rw-r--r--src/p2putil.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/p2putil.c b/src/p2putil.c
index 02c02b4d3..58a75a112 100644
--- a/src/p2putil.c
+++ b/src/p2putil.c
@@ -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++;