i2c(8): uninitialized variable (UNINIT).
If i2c_opt.width is somehow zero, the bufsize will be left uninitialized and make cause trouble later on. CID: 1331549
This commit is contained in:
parent
8877d1dbe6
commit
b1f46f712f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299586
@ -294,7 +294,8 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
err_msg = "error: offset malloc";
|
err_msg = "error: offset malloc";
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
bufsize = 0;
|
||||||
|
|
||||||
switch(i2c_opt.mode) {
|
switch(i2c_opt.mode) {
|
||||||
case I2C_MODE_STOP_START:
|
case I2C_MODE_STOP_START:
|
||||||
|
Loading…
Reference in New Issue
Block a user