ia64/xen-unstable

changeset 18850:2797ad550925

xenpmd: Adjust strncat() length to avoid static buffer overflow.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Dec 02 22:17:22 2008 +0000 (2008-12-02)
parents fc5208167bb6
children 28d485613eb3
files tools/xenpmd/xenpmd.c
line diff
     1.1 --- a/tools/xenpmd/xenpmd.c	Tue Dec 02 11:53:24 2008 +0000
     1.2 +++ b/tools/xenpmd/xenpmd.c	Tue Dec 02 22:17:22 2008 +0000
     1.3 @@ -373,7 +373,7 @@ void write_battery_info_to_xenstore(stru
     1.4               (unsigned int)strlen(info->serial_number), info->serial_number,
     1.5               (unsigned int)strlen(info->battery_type), info->battery_type,
     1.6               (unsigned int)strlen(info->oem_info), info->oem_info);
     1.7 -    strncat(val+73, string_info, 1024);
     1.8 +    strncat(val+73, string_info, 1024-73-1);
     1.9      xs_write(xs, XBT_NULL, "/pm/bif", 
    1.10               val, 73+8+strlen(info->model_number)+strlen(info->serial_number)+
    1.11               strlen(info->battery_type)+strlen(info->oem_info)+1);