Browse Source

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.
Janusz Dziedzic 13 years ago
parent
commit
f1afcb391e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/p2p/p2p_group.c

+ 1 - 1
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);