Skip to content

Commit

Permalink
b43: debugfs SHM read buffer overrun fix
Browse files Browse the repository at this point in the history
Fix possible buffer overrun.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Michael Buesch authored and Jeff Garzik committed Nov 10, 2007
1 parent 80fda03 commit 30c4ae4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/b43/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static ssize_t shm_read_file(struct b43_wldev *dev,
__le16 *le16buf = (__le16 *)buf;

for (i = 0; i < 0x1000; i++) {
if (bufsize <= 0)
if (bufsize < sizeof(tmp))
break;
tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i);
le16buf[i] = cpu_to_le16(tmp);
Expand Down

0 comments on commit 30c4ae4

Please sign in to comment.