diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-05-25 23:41:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:46 -0400 |
commit | 707985b3850f6ff168340e20b7f6b783782fb8ed (patch) | |
tree | 38e3d8501615370595cdbf002197959f71dcc8e6 | |
parent | e5b3d472ad4eaa9013fd9f67f7a1b132f3ec910c (diff) |
[PATCH] libertas: fix big-endian associate command.
Byte-swapping length fields and then passing them to memcpy() considered
harmful.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/join.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c index 781b563a2f4f..b728f7fb9e34 100644 --- a/drivers/net/wireless/libertas/join.c +++ b/drivers/net/wireless/libertas/join.c | |||
@@ -362,25 +362,25 @@ int libertas_cmd_80211_associate(wlan_private * priv, | |||
362 | 362 | ||
363 | ssid = (struct mrvlietypes_ssidparamset *) pos; | 363 | ssid = (struct mrvlietypes_ssidparamset *) pos; |
364 | ssid->header.type = cpu_to_le16(TLV_TYPE_SSID); | 364 | ssid->header.type = cpu_to_le16(TLV_TYPE_SSID); |
365 | ssid->header.len = cpu_to_le16(bss->ssid.ssidlength); | 365 | tmplen = bss->ssid.ssidlength; |
366 | memcpy(ssid->ssid, bss->ssid.ssid, ssid->header.len); | 366 | ssid->header.len = cpu_to_le16(tmplen); |
367 | pos += sizeof(ssid->header) + ssid->header.len; | 367 | memcpy(ssid->ssid, bss->ssid.ssid, tmplen); |
368 | ssid->header.len = cpu_to_le16(ssid->header.len); | 368 | pos += sizeof(ssid->header) + tmplen; |
369 | 369 | ||
370 | phy = (struct mrvlietypes_phyparamset *) pos; | 370 | phy = (struct mrvlietypes_phyparamset *) pos; |
371 | phy->header.type = cpu_to_le16(TLV_TYPE_PHY_DS); | 371 | phy->header.type = cpu_to_le16(TLV_TYPE_PHY_DS); |
372 | phy->header.len = cpu_to_le16(sizeof(phy->fh_ds.dsparamset)); | 372 | tmplen = sizeof(phy->fh_ds.dsparamset); |
373 | phy->header.len = cpu_to_le16(tmplen); | ||
373 | memcpy(&phy->fh_ds.dsparamset, | 374 | memcpy(&phy->fh_ds.dsparamset, |
374 | &bss->phyparamset.dsparamset.currentchan, | 375 | &bss->phyparamset.dsparamset.currentchan, |
375 | sizeof(phy->fh_ds.dsparamset)); | 376 | tmplen); |
376 | pos += sizeof(phy->header) + phy->header.len; | 377 | pos += sizeof(phy->header) + tmplen; |
377 | phy->header.len = cpu_to_le16(phy->header.len); | ||
378 | 378 | ||
379 | ss = (struct mrvlietypes_ssparamset *) pos; | 379 | ss = (struct mrvlietypes_ssparamset *) pos; |
380 | ss->header.type = cpu_to_le16(TLV_TYPE_CF); | 380 | ss->header.type = cpu_to_le16(TLV_TYPE_CF); |
381 | ss->header.len = cpu_to_le16(sizeof(ss->cf_ibss.cfparamset)); | 381 | tmplen = sizeof(ss->cf_ibss.cfparamset); |
382 | pos += sizeof(ss->header) + ss->header.len; | 382 | ss->header.len = cpu_to_le16(tmplen); |
383 | ss->header.len = cpu_to_le16(ss->header.len); | 383 | pos += sizeof(ss->header) + tmplen; |
384 | 384 | ||
385 | rates = (struct mrvlietypes_ratesparamset *) pos; | 385 | rates = (struct mrvlietypes_ratesparamset *) pos; |
386 | rates->header.type = cpu_to_le16(TLV_TYPE_RATES); | 386 | rates->header.type = cpu_to_le16(TLV_TYPE_RATES); |