ia64/linux-2.6.18-xen.hg

diff drivers/pci/reserve.c @ 895:20be7f6d414a

pci/guestdev, iomul: use strlcpy()

use strlcpy() to make them robust.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 04 10:45:49 2009 +0100 (2009-06-04)
parents c7c92f868aa1
children
line diff
     1.1 --- a/drivers/pci/reserve.c	Thu Jun 04 10:33:52 2009 +0100
     1.2 +++ b/drivers/pci/reserve.c	Thu Jun 04 10:45:49 2009 +0100
     1.3 @@ -135,9 +135,9 @@ unsigned long pci_reserve_size_mem(struc
     1.4  
     1.5  static int __init pci_reserve_setup(char *str)
     1.6  {
     1.7 -	if (strlen(str) > sizeof(pci_reserve_param))
     1.8 +	if (strlen(str) >= sizeof(pci_reserve_param))
     1.9  		return 0;
    1.10 -	strcpy(pci_reserve_param, str);
    1.11 +	strlcpy(pci_reserve_param, str, sizeof(pci_reserve_param));
    1.12  	return 1;
    1.13  }
    1.14  __setup("pci_reserve=", pci_reserve_setup);