From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Guyader Subject: [PATH] Fix overflow in xc_set_cpufreq_gov Date: Fri, 12 Dec 2008 12:17:50 +0000 Message-ID: <4942566E.9010907@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020603010800070406060007" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------020603010800070406060007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This fix an overflow on scaling_governor. Recent compilers fail on this kind of statements. Signed-off-by: Jean Guyader -- Jean Guyader --------------020603010800070406060007 Content-Type: text/plain; name="fix_xc_set_cpufreq_gov_overflow.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix_xc_set_cpufreq_gov_overflow.patch" diff -r 68b76ad4faf7 tools/libxc/xc_pm.c --- a/tools/libxc/xc_pm.c Thu Dec 11 22:32:20 2008 +0000 +++ b/tools/libxc/xc_pm.c Fri Dec 12 12:14:22 2008 +0000 @@ -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); } --------------020603010800070406060007 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------020603010800070406060007--