From 187a9dca3f2f90341e321a3998a5b0c74111f77c Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 6 Nov 2007 22:48:36 +0100 Subject: [PATCH] b43legacy: fix possible buffer overrun in debugfs Fix possible buffer overrun. The patch to b43 by Michael Buesch has been ported to b43legacy. Signed-off-by: Stefano Brivio Signed-off-by: John W. Linville --- drivers/net/wireless/b43legacy/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c index eefa6fb796..619b4534ef 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 __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); -- 2.39.5