Input: atmel_mxt_ts - verify object size in mxt_write_object
Don't allow writing past the length of an object. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
committed by
Dmitry Torokhov
parent
71b3e938cb
commit
d1ff320f0a
@@ -506,7 +506,7 @@ static int mxt_write_object(struct mxt_data *data,
|
|||||||
u16 reg;
|
u16 reg;
|
||||||
|
|
||||||
object = mxt_get_object(data, type);
|
object = mxt_get_object(data, type);
|
||||||
if (!object)
|
if (!object || offset >= object->size + 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
reg = object->start_address;
|
reg = object->start_address;
|
||||||
|
Reference in New Issue
Block a user