From: Janusz Dziedzic Date: Wed, 12 Oct 2011 22:06:11 +0000 (+0300) Subject: P2P: Fix wpabuf reuse on p2p_group_notif_noa() X-Git-Tag: hostap-1-bp~177 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1afcb391e4e514a2dcdb5167f7acdfb13b07db1;p=thirdparty%2Fhostap.git P2P: Fix wpabuf reuse on p2p_group_notif_noa() This currently unused function would have triggered wpabuf overflows due to incorrect variable being reset to zero in the case the old NoA wpabuf was large enough for the new data. --- diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c index 14a475d01..cc2542dcd 100644 --- a/src/p2p/p2p_group.c +++ b/src/p2p/p2p_group.c @@ -494,7 +494,7 @@ int p2p_group_notif_noa(struct p2p_group *group, const u8 *noa, } else { if (group->noa) { if (wpabuf_size(group->noa) >= noa_len) { - group->noa->size = 0; + group->noa->used = 0; wpabuf_put_data(group->noa, noa, noa_len); } else { wpabuf_free(group->noa);