debuggers.hg
changeset 18952:db0c6d297d00
xc_pm: Fix off-by-one error in string array access.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Sat Dec 13 15:04:53 2008 +0000 (2008-12-13) |
parents | df2ee10097c7 |
children | e767f80d4bcc |
files | tools/libxc/xc_pm.c |
line diff
1.1 --- a/tools/libxc/xc_pm.c Sat Dec 13 15:02:55 2008 +0000 1.2 +++ b/tools/libxc/xc_pm.c Sat Dec 13 15:04:53 2008 +0000 1.3 @@ -285,7 +285,7 @@ int xc_set_cpufreq_gov(int xc_handle, in 1.4 sysctl.u.pm_op.cmd = SET_CPUFREQ_GOV; 1.5 sysctl.u.pm_op.cpuid = cpuid; 1.6 strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN); 1.7 - scaling_governor[CPUFREQ_NAME_LEN] = '\0'; 1.8 + scaling_governor[CPUFREQ_NAME_LEN - 1] = '\0'; 1.9 1.10 return xc_sysctl(xc_handle, &sysctl); 1.11 }