Skip to content

Commit

Permalink
[PATCH] PCI Hotplug: Fix buffer overrun in rpadlpar_sysfs.c
Browse files Browse the repository at this point in the history
Signed-off-by: Linda Xie <lxie@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Linda Xie authored and Linus Torvalds committed Sep 22, 2005
1 parent 3c6de92 commit 02fe75a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/hotplug/rpadlpar_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 02fe75a

Please sign in to comment.