aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sysctl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 9990e10192e8..ad0425a8f709 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2201,14 +2201,12 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen,
2201 if (get_user(len, oldlenp)) 2201 if (get_user(len, oldlenp))
2202 return -EFAULT; 2202 return -EFAULT;
2203 if (len) { 2203 if (len) {
2204 l = strlen(table->data); 2204 l = strlen(table->data)+1;
2205 if (len > l) len = l; 2205 if (len > l) len = l;
2206 if (len >= table->maxlen) 2206 if (len >= table->maxlen)
2207 len = table->maxlen; 2207 len = table->maxlen;
2208 if(copy_to_user(oldval, table->data, len)) 2208 if(copy_to_user(oldval, table->data, len))
2209 return -EFAULT; 2209 return -EFAULT;
2210 if(put_user(0, ((char __user *) oldval) + len))
2211 return -EFAULT;
2212 if(put_user(len, oldlenp)) 2210 if(put_user(len, oldlenp))
2213 return -EFAULT; 2211 return -EFAULT;
2214 } 2212 }