aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/openpromfs/inode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index 464e2bce0203..c0cbe97cdc60 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -448,10 +448,11 @@ static ssize_t property_write(struct file *filp, const char __user *buf,
448 *q |= simple_strtoul (tmp, NULL, 16); 448 *q |= simple_strtoul (tmp, NULL, 16);
449 buf += last_cnt; 449 buf += last_cnt;
450 } else { 450 } else {
451 char tchars[17]; /* XXX yuck... */ 451 char tchars[2 * sizeof(long) + 1];
452 452
453 if (copy_from_user(tchars, buf, 16)) 453 if (copy_from_user(tchars, buf, sizeof(tchars) - 1))
454 return -EFAULT; 454 return -EFAULT;
455 tchars[sizeof(tchars) - 1] = '\0';
455 *q = simple_strtoul (tchars, NULL, 16); 456 *q = simple_strtoul (tchars, NULL, 16);
456 buf += 9; 457 buf += 9;
457 } 458 }