mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
[PATCH] PCI Hotplug: Fix buffer overrun in rpadlpar_sysfs.c
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>
This commit is contained in:
parent
3c6de9295d
commit
02fe75a9ad
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user