From: Linda Xie Date: Thu, 22 Sep 2005 07:48:24 +0000 (-0700) Subject: [PATCH] PCI Hotplug: Fix buffer overrun in rpadlpar_sysfs.c X-Git-Tag: v2.6.14-rc3~51^2~82 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=02fe75a9ad797b4f8ccf1ee8e49833b77cc30c6a;p=linux-2.6-omap-h63xx.git [PATCH] PCI Hotplug: Fix buffer overrun in rpadlpar_sysfs.c Signed-off-by: Linda Xie Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c index 752e6513c44..db69be85b45 100644 --- a/drivers/pci/hotplug/rpadlpar_sysfs.c +++ b/drivers/pci/hotplug/rpadlpar_sysfs.c @@ -62,7 +62,7 @@ static ssize_t add_slot_store(struct dlpar_io_attr *dlpar_attr, 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 dlpar_io_attr *dlpar_attr, 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);