jebtang / likwid

Automatically exported from code.google.com/p/likwid
GNU General Public License v3.0
0 stars 0 forks source link

CPUID features uninitialized bytes #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The concatenation of features in the src/cpuid.c could lead to broken strings.
The trivial patch is enclosed.

What steps will reproduce the problem?
1. running valgrind with likwid.

What version of the product are you using?
Änderung:        551:57f322cdba1e
Zweig:           v3.1
Marke:           tip
Nutzer:          Thomas.Roehl <Thomas.Roehl@googlemail.com>
Datum:           Tue Mar 18 12:10:29 2014 +0100
Zusammenfassung: Enhanced MSR device check for Xeon Phi coprocessors

Please provide any additional information below.
Bugfix:

--- tmp/cpuid.c 2014-03-26 18:39:16.658010754 +0100
+++ src/cpuid.c 2014-03-26 18:39:12.846010887 +0100
@@ -524,6 +524,7 @@

     cpuid_info.featureFlags = 0;
     cpuid_info.features = (char*) malloc(200*sizeof(char));
+    cpuid_info.features[0] = 0;
     if (ecx & (1<<0))
     {
         strcat(cpuid_info.features, "SSE3 ");

Original issue reported on code.google.com by JulianKu...@googlemail.com on 26 Mar 2014 at 5:48

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 81626da3bf27.

Original comment by Thomas.R...@googlemail.com on 28 Mar 2014 at 3:29