summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-11-02 19:30:21 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2008-11-10 10:50:05 -0800
commitaafa27b18c721966bb4320d81781b56176c94cd7 (patch)
treed41040cdd12e838f07a808bc570e94bc0b51f127
parent52b5acdd4f41f95472437cdc8886eb195a9e433a (diff)
downloadlwn-aafa27b18c721966bb4320d81781b56176c94cd7.tar.gz
lwn-aafa27b18c721966bb4320d81781b56176c94cd7.zip
libertas: fix buffer overrun
commit 48735d8d8bd701b1e0cd3d49c21e5e385ddcb077 upstream If somebody sends an invalid beacon/probe response, that can trash the whole BSS descriptor. The descriptor is, luckily, large enough so that it cannot scribble past the end of it; it's well above 400 bytes long. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/wireless/libertas/scan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 69f94c92b32d..9335d715e1de 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -787,8 +787,8 @@ static int lbs_process_bss(struct bss_descriptor *bss,
switch (elem->id) {
case MFIE_TYPE_SSID:
- bss->ssid_len = elem->len;
- memcpy(bss->ssid, elem->data, elem->len);
+ bss->ssid_len = min_t(int, 32, elem->len);
+ memcpy(bss->ssid, elem->data, bss->ssid_len);
lbs_deb_scan("got SSID IE: '%s', len %u\n",
escape_essid(bss->ssid, bss->ssid_len),
bss->ssid_len);