mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-29 12:50:43 +00:00
Prevent buffer overrun during SMBus Block Read when client responds
(mmh) with illegal read size. Patch by Sergey Vlasov <vsu@altlinux.ru>. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1940 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
7c3bb9df01
commit
69ef356b2c
1 file changed
+2
@@ -264,6 +264,8 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
|
||||
break;
|
||||
case VT596_BLOCK_DATA:
|
||||
data->block[0] = inb_p(SMBHSTDAT0);
|
||||
if (data->block[0] > 32)
|
||||
data->block[0] = 32;
|
||||
i = inb_p(SMBHSTCNT); /* Reset SMBBLKDAT */
|
||||
for (i = 1; i <= data->block[0]; i++)
|
||||
data->block[i] = inb_p(SMBBLKDAT);
|
||||
|
||||
Reference in new issue
Block a user