[patch 08/18] PCI Hotplug: Fix buffer overrun in rpadlpar_sysfs.c

Greg KH
2005-09-22T07:49:30Z

[-- Attachment #1: pci-buffer-overrun-rpaldpar.patch --]
[-- Type: text/plain, Size: 783 bytes --]

From: Linda Xie <lxiep@us.ibm.com>

Signed-off-by: Linda Xie <lxie@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/pci/hotplug/rpadlpar_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- scsi-2.6.orig/drivers/pci/hotplug/rpadlpar_sysfs.c 2005-09-20 05:59:55.000000000 -0700
+++ scsi-2.6/drivers/pci/hotplug/rpadlpar_sysfs.c 2005-09-21 17:29:34.000000000 -0700
@@ -62,7 +62,7 @@
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 @@
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);

--