lkml.org 
[lkml]   [2004]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 47/47] Check the range for HIDIOC?USAGES num_values.
Date
From
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/input

===================================================================

ChangeSet@1.1859, 2004-07-29 14:13:12+02:00, vojtech@suse.cz
input: Check the range for HIDIOC?USAGES num_values.

Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>


hiddev.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)

===================================================================

diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
--- a/drivers/usb/input/hiddev.c Thu Jul 29 14:38:23 2004
+++ b/drivers/usb/input/hiddev.c Thu Jul 29 14:38:23 2004
@@ -633,14 +633,11 @@
} else if (uref->usage_index >= field->report_count)
goto inval;

- else if ((cmd == HIDIOCGUSAGES ||
- cmd == HIDIOCSUSAGES) &&
- (uref->usage_index + uref_multi->num_values >=
- field->report_count ||
- uref->usage_index + uref_multi->num_values <
- uref->usage_index))
+ else if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) &&
+ (uref_multi->num_values >= HID_MAX_MULTI_USAGES ||
+ uref->usage_index + uref_multi->num_values >= field->report_count ||
+ uref->usage_index + uref_multi->num_values < uref->usage_index))
goto inval;
-
}

switch (cmd) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:1.565 / U:0.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site