mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 06:15:15 +00:00
Prevent possible (but harmless and unlikely) buffer overflow.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3050 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -66,7 +66,6 @@ int main(int argc, char *argv[])
|
||||
int bank = 0, bankreg = 0x4E;
|
||||
char filename[20];
|
||||
long funcs;
|
||||
unsigned char cblock[256];
|
||||
int block[256];
|
||||
int pec = 0;
|
||||
int flags = 0;
|
||||
@@ -356,6 +355,8 @@ int main(int argc, char *argv[])
|
||||
/* do the block transaction */
|
||||
if (size == I2C_SMBUS_BLOCK_DATA
|
||||
|| size == I2C_SMBUS_I2C_BLOCK_DATA) {
|
||||
unsigned char cblock[288];
|
||||
|
||||
if (size == I2C_SMBUS_BLOCK_DATA) {
|
||||
res = i2c_smbus_read_block_data(file, bank,
|
||||
cblock);
|
||||
|
Reference in New Issue
Block a user