Skip to content

Commit

Permalink
Input: atmel_mxt_ts - verify object size in mxt_write_object
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Kurtz authored and Dmitry Torokhov committed May 11, 2012
1 parent 71b3e93 commit d1ff320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static int mxt_write_object(struct mxt_data *data,
u16 reg;

object = mxt_get_object(data, type);
if (!object)
if (!object || offset >= object->size + 1)
return -EINVAL;

reg = object->start_address;
Expand Down

0 comments on commit d1ff320

Please sign in to comment.