浏览代码

cfg80211: Use the correct IE buffer pointer

If the IE buffer was allocated, the pub.information_elements pointer
was also changed to the allocated space. So we must not assume anymore
that the pointer points at the "found" tail.

So if it was allocated previously, take the codebranch that grows the
buffer size (if necessary) and put the data into the allocated buffer.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michael Buesch 16 年之前
父节点
当前提交
44e1b98f73
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/wireless/scan.c

+ 1 - 1
net/wireless/scan.c

@@ -377,7 +377,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
 			size_t used = dev->wiphy.bss_priv_size + sizeof(*res);
 			size_t used = dev->wiphy.bss_priv_size + sizeof(*res);
 			size_t ielen = res->pub.len_information_elements;
 			size_t ielen = res->pub.len_information_elements;
 
 
-			if (ksize(found) >= used + ielen) {
+			if (!found->ies_allocated && ksize(found) >= used + ielen) {
 				memcpy(found->pub.information_elements,
 				memcpy(found->pub.information_elements,
 				       res->pub.information_elements, ielen);
 				       res->pub.information_elements, ielen);
 				found->pub.len_information_elements = ielen;
 				found->pub.len_information_elements = ielen;