Messages in this thread Patch in this message | | | Date | Fri, 09 Sep 2005 17:00:41 -0500 | From | Linda Xie <> | Subject | [PATCH]: Fix buffer overrun in rpadlpar_sysfs.c |
| |
Hi Greg,
The attached patch was created against 2.6.13-git9.
Please consider it for inclusion.
Thanks,
Linda
Signed-off-by: Linda Xie <lxie@us.ibm.com>
--- linux-2.6.13-git9/drivers/pci/hotplug/rpadlpar_sysfs.c 2005-08-28 18:41:01.000000000 -0500 +++ linux-2.6.13-git9-linda/drivers/pci/hotplug/rpadlpar_sysfs.c 2005-09-09 16:28:56.000000000 -0500 @@ -62,7 +62,7 @@ static ssize_t add_slot_store(struct dlp char drc_name[MAX_DRC_NAME_LEN]; char *end; - if (nbytes > MAX_DRC_NAME_LEN) + if (nbytes >= MAX_DRC_NAME_LEN) return 0; memcpy(drc_name, buf, nbytes); @@ -83,7 +83,7 @@ static ssize_t remove_slot_store(struct char drc_name[MAX_DRC_NAME_LEN]; char *end; - if (nbytes > MAX_DRC_NAME_LEN) + if (nbytes >= MAX_DRC_NAME_LEN) return 0; memcpy(drc_name, buf, nbytes); | |