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

[Xen-changelog] [xen-unstable] xc_pm: Fix off-by-one error in string array access.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1229180693 0
# Node ID db0c6d297d006c86056a45343e29be962595f211
# Parent  df2ee10097c7b076dccc1c705dfe266cb0172a59
xc_pm: Fix off-by-one error in string array access.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 tools/libxc/xc_pm.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r df2ee10097c7 -r db0c6d297d00 tools/libxc/xc_pm.c
--- a/tools/libxc/xc_pm.c       Sat Dec 13 15:02:55 2008 +0000
+++ b/tools/libxc/xc_pm.c       Sat Dec 13 15:04:53 2008 +0000
@@ -285,7 +285,7 @@ int xc_set_cpufreq_gov(int xc_handle, in
     sysctl.u.pm_op.cmd = SET_CPUFREQ_GOV;
     sysctl.u.pm_op.cpuid = cpuid;
     strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN);
-    scaling_governor[CPUFREQ_NAME_LEN] = '\0';
+    scaling_governor[CPUFREQ_NAME_LEN - 1] = '\0';
 
     return xc_sysctl(xc_handle, &sysctl);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.