Commit 187a9dca authored by Stefano Brivio's avatar Stefano Brivio Committed by Jeff Garzik
Browse files

b43legacy: fix possible buffer overrun in debugfs

Fix possible buffer overrun.

The patch to b43 by Michael Buesch <> has been ported to
Signed-off-by: default avatarStefano Brivio <>
Signed-off-by: default avatarJohn W. Linville <>
parent 35c7e660
......@@ -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))
tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i);
le16buf[i] = cpu_to_le16(tmp);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment