Skip to content

Commit

Permalink
b43legacy: fix possible buffer overrun in debugfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefano Brivio authored and Jeff Garzik committed Nov 10, 2007
1 parent 35c7e66 commit 187a9dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/b43legacy/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs
__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);
Expand Down

0 comments on commit 187a9dc

Please sign in to comment.