2007-11-06 22:12:55

by Stefano Brivio

[permalink] [raw]
Subject: [PATCH 3/7] b43legacy: fix possible buffer overrun in debugfs

Fix possible buffer overrun.

The patch to b43 by Michael Buesch <[email protected]> has been ported to
b43legacy.


Signed-off-by: Stefano Brivio <[email protected]>

----

Index: wireless-2.6/drivers/net/wireless/b43legacy/debugfs.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43legacy/debugfs.c
+++ wireless-2.6/drivers/net/wireless/b43legacy/debugfs.c
@@ -124,7 +124,7 @@ static ssize_t shm_read_file(struct b43l
__le16 *le16buf = (__le16 *)buf;

for (i = 0; i < 0x1000; i++) {
- if (bufsize <= 0)
+ if (bufsize < sizeof(tmp))
break;
tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i);
le16buf[i] = cpu_to_le16(tmp);



--
Ciao
Stefano

--
Ciao
Stefano