Fix overflow in xc_set_cpufreq_gov
This fix an overflow on scaling_governor. Recent compilers fail on this kind of statements.
Signed-off-by Jean Guyader <[email protected]>
Signature · 1 line
Jean Guyader
tools/libxc/xc_pm.c +1 -1
@@ -285,7 +285,7 @@ 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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel