diff options
author | Stefano Brivio <stefano.brivio@polimi.it> | 2007-11-06 16:48:36 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-11-10 04:25:13 -0500 |
commit | 187a9dca3f2f90341e321a3998a5b0c74111f77c (patch) | |
tree | 1de4b4f1ac9d2b57caa600eca80739d7f7e52bed | |
parent | 35c7e6602b81bdacb745f04236a419402777139e (diff) |
b43legacy: fix possible buffer overrun in debugfs
Fix possible buffer overrun.
The patch to b43 by Michael Buesch <mb@bu3sch.de> has been ported to
b43legacy.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43legacy/debugfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c index eefa6fb79685..619b4534ef09 100644 --- a/drivers/net/wireless/b43legacy/debugfs.c +++ b/drivers/net/wireless/b43legacy/debugfs.c | |||
@@ -124,7 +124,7 @@ static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs | |||
124 | __le16 *le16buf = (__le16 *)buf; | 124 | __le16 *le16buf = (__le16 *)buf; |
125 | 125 | ||
126 | for (i = 0; i < 0x1000; i++) { | 126 | for (i = 0; i < 0x1000; i++) { |
127 | if (bufsize <= 0) | 127 | if (bufsize < sizeof(tmp)) |
128 | break; | 128 | break; |
129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); | 129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); |
130 | le16buf[i] = cpu_to_le16(tmp); | 130 | le16buf[i] = cpu_to_le16(tmp); |