Updated to 2.6.32.27
/drivers/parisc/led.c
blob:9581d3619450d609ca69e305d4fcad7148f9ab93 -> blob:cc31baa31659782183de1980513265f3882edb31
--- drivers/parisc/led.c
+++ drivers/parisc/led.c
@@ -182,16 +182,18 @@ static int led_proc_read(char *page, cha
static int led_proc_write(struct file *file, const char *buf,
unsigned long count, void *data)
{
- char *cur, lbuf[count + 1];
+ char *cur, lbuf[32];
int d;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
- memset(lbuf, 0, count + 1);
+ if (count >= sizeof(lbuf))
+ count = sizeof(lbuf)-1;
if (copy_from_user(lbuf, buf, count))
return -EFAULT;
+ lbuf[count] = 0;
cur = lbuf;