lkml.org 
[lkml]   [2004]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/7] evdev_read: report -EINVAL when buffer is to small
Date

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


ChangeSet@1.1989, 2004-11-12 00:36:10-05:00, dtor_core@ameritech.net
Input: evdev - return -EINVAL from evdev_read if read buffer
is too small.

Based on the patch by James Lamanna.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


evdev.c | 3 +++
1 files changed, 3 insertions(+)


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



diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c
--- a/drivers/input/evdev.c 2004-11-12 01:01:02 -05:00
+++ b/drivers/input/evdev.c 2004-11-12 01:01:02 -05:00
@@ -169,6 +169,9 @@
struct evdev_list *list = file->private_data;
int retval;

+ if (count < sizeof(struct input_event))
+ return -EINVAL;
+
if (list->head == list->tail && list->evdev->exist && (file->f_flags & O_NONBLOCK))
return -EAGAIN;

-
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:07    [W:0.031 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site