Signed-off-by: Guenter Roeck <guenter.roeck@xxxxxxxxxxxx> --- tools/i2cset.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tools/i2cset.c b/tools/i2cset.c index ed6ada2..b512081 100644 --- a/tools/i2cset.c +++ b/tools/i2cset.c @@ -300,6 +300,11 @@ int main(int argc, char *argv[]) fprintf(stderr, "Error: Data value mask invalid!\n"); help(); } + if (((size == I2C_SMBUS_BYTE || size == I2C_SMBUS_BYTE_DATA) + && vmask > 0xff) || vmask > 0xffff) { + fprintf(stderr, "Error: Data value mask out of range!\n"); + help(); + } } file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0); -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html