]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] fix for buffer limit for long in sysctl.c
authorStéphane Eranian <eranian@hpl.hp.com>
Wed, 28 Jul 2004 16:03:00 +0000 (09:03 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 28 Jul 2004 16:03:00 +0000 (09:03 -0700)
Fix a bug in do_proc_doulongvec_minmax() where the the string buffer was
too short to parse a 64-bit number expressed in decimal.  That was causing
problems with entries in /proc/sys using long and allowing large number
(such as -1)

Signed-off-by: Stephane Eranian <eranian@hpl.hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/sysctl.c

index 0df0748d56bd39a3787e554c1c3c6b1a2696a60f..3ae9e7568738c4dc9d52aac6695c09e2a668369d 100644 (file)
@@ -1436,7 +1436,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
                              int write, void *data),
                  void *data)
 {
-#define TMPBUFLEN 20
+#define TMPBUFLEN 21
        int *i, vleft, first=1, neg, val;
        unsigned long lval;
        size_t left, len;
@@ -1676,7 +1676,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
                                     unsigned long convmul,
                                     unsigned long convdiv)
 {
-#define TMPBUFLEN 20
+#define TMPBUFLEN 21
        unsigned long *i, *min, *max, val;
        int vleft, first=1, neg;
        size_t len, left;