diff for duplicates of <20100907133805.GA20050@gvim.org> diff --git a/a/1.txt b/N1/1.txt index d742e4d..db8a8c3 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -18,7 +18,7 @@ On Mon, Sep 06, 2010 at 11:22:27PM -0700, mark gross wrote: > > --- a/kernel/pm_qos_params.c > > +++ b/kernel/pm_qos_params.c > > @@ -389,10 +389,11 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, -> > } else if (count = 11) { /* len('0x12345678/0') */ +> > } else if (count == 11) { /* len('0x12345678/0') */ > > if (copy_from_user(ascii_value, buf, 11)) > > return -EFAULT; > > + ascii_value[10] = '\0'; @@ -59,11 +59,12 @@ On Mon, Sep 06, 2010 at 11:22:27PM -0700, mark gross wrote: > } > spin_unlock_irqrestore(&pm_qos_lock, flags); > @@ -374,10 +374,12 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, -> } else if (count = 11) { /* len('0x12345678/0') */ +> } else if (count == 11) { /* len('0x12345678/0') */ > if (copy_from_user(ascii_value, buf, 11)) > return -EFAULT; > + if (strlen(ascii_value) > 10) - should be ! + should be != + > + return -EINVAL; > x = sscanf(ascii_value, "%x", &value); > if (x != 1) @@ -104,7 +105,7 @@ index f42d3f7..aae58d2 100644 } spin_unlock_irqrestore(&pm_qos_lock, flags); @@ -374,10 +374,12 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, - } else if (count = 11) { /* len('0x12345678/0') */ + } else if (count == 11) { /* len('0x12345678/0') */ if (copy_from_user(ascii_value, buf, 11)) return -EFAULT; + if (strlen(ascii_value) != 10) diff --git a/a/content_digest b/N1/content_digest index e1c53cc..6427d48 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -2,7 +2,7 @@ "ref\020100907062227.GB25651@gvim.org\0" "From\0mark gross <markgross@thegnar.org>\0" "Subject\0Re: [patch] pm_qos_params: cleanup: terminate a string\0" - "Date\0Tue, 07 Sep 2010 13:38:05 +0000\0" + "Date\0Tue, 7 Sep 2010 06:38:05 -0700\0" "To\0mark gross <markgross@thegnar.org>\0" "Cc\0Dan Carpenter <error27@gmail.com>" Rafael J. Wysocki <rjw@sisk.pl> @@ -33,7 +33,7 @@ "> > --- a/kernel/pm_qos_params.c\n" "> > +++ b/kernel/pm_qos_params.c\n" "> > @@ -389,10 +389,11 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,\n" - "> > \t} else if (count = 11) { /* len('0x12345678/0') */\n" + "> > \t} else if (count == 11) { /* len('0x12345678/0') */\n" "> > \t\tif (copy_from_user(ascii_value, buf, 11))\n" "> > \t\t\treturn -EFAULT;\n" "> > +\t\tascii_value[10] = '\\0';\n" @@ -74,11 +74,12 @@ "> \t}\n" "> \tspin_unlock_irqrestore(&pm_qos_lock, flags);\n" "> @@ -374,10 +374,12 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,\n" - "> \t} else if (count = 11) { /* len('0x12345678/0') */\n" + "> \t} else if (count == 11) { /* len('0x12345678/0') */\n" "> \t\tif (copy_from_user(ascii_value, buf, 11))\n" "> \t\t\treturn -EFAULT;\n" "> +\t\tif (strlen(ascii_value) > 10)\n" - " should be !\n" + " should be !=\n" + "\n" "> +\t\t\treturn -EINVAL;\n" "> \t\tx = sscanf(ascii_value, \"%x\", &value);\n" "> \t\tif (x != 1)\n" @@ -119,7 +120,7 @@ " \t}\n" " \tspin_unlock_irqrestore(&pm_qos_lock, flags);\n" "@@ -374,10 +374,12 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,\n" - " \t} else if (count = 11) { /* len('0x12345678/0') */\n" + " \t} else if (count == 11) { /* len('0x12345678/0') */\n" " \t\tif (copy_from_user(ascii_value, buf, 11))\n" " \t\t\treturn -EFAULT;\n" "+\t\tif (strlen(ascii_value) != 10)\n" @@ -135,4 +136,4 @@ "-- \n" 1.7.0.4 -7d7b7f7be379032b3d9e462495953286b01d65b8b56a512c8b2a5c6e0f29da25 +92c08de55d124528a4459bada249b08b2e643c3aac7887297121e2064ccf94ce
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.