]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix wpabuf reuse on p2p_group_notif_noa()
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Wed, 12 Oct 2011 22:06:11 +0000 (01:06 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 12 Oct 2011 22:06:11 +0000 (01:06 +0300)
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.

src/p2p/p2p_group.c

index 14a475d01908c1a226c24347d8ea7229d94b59be..cc2542dcd0c7f6da71248966d90a31c08ef2c9aa 100644 (file)
@@ -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);