[PATCH]: Fix buffer overrun in rpadlpar_sysfs.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,

The attached patch was created against 2.6.13-git9.

Please consider it for inclusion.


Thanks,

Linda


Signed-off-by: Linda Xie <[email protected]>


--- 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);

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux