All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATH] Fix overflow in xc_set_cpufreq_gov
@ 2008-12-12 12:17 Jean Guyader
  0 siblings, 0 replies; only message in thread
From: Jean Guyader @ 2008-12-12 12:17 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]


This fix an overflow on scaling_governor. Recent compilers fail on this
kind of statements.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>

-- 
Jean Guyader

[-- Attachment #2: fix_xc_set_cpufreq_gov_overflow.patch --]
[-- Type: text/plain, Size: 460 bytes --]

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);
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-12 12:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-12 12:17 [PATH] Fix overflow in xc_set_cpufreq_gov Jean Guyader

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.