diff options
author | Colin Ian King <colin.king@canonical.com> | 2016-08-31 10:21:25 +0100 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2016-09-08 12:46:43 +0200 |
commit | cc965781d34287fbc0233f054691a3a51f2c7e29 (patch) | |
tree | eff7226e90a691c8155fc6de47a690f8c636200a /idlestat.c | |
parent | 31cc77aace22f9025f0bf8178914b3c8045276e6 (diff) |
Fix TRACE_IPIIRQ_FORMAT string format width overflow scan issue
cppcheck detected a potential buffer overflow with a %s scanf width format
specifier being larger than the destination buffer. Reduce the scan size to
match the expected buffer size.
Fixes error:
[idlestat.c:974]: (error) Width 32 given in format string (no. 2) is larger
than destination buffer 'irqname[17]', use %16s to prevent overflowing it.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'idlestat.c')
-rw-r--r-- | idlestat.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -950,7 +950,7 @@ void output_cstate_info(FILE *f, struct cpu_topology * topo, int nrcpus) } #define TRACE_IRQ_FORMAT "%*[^[][%d] %*[^=]=%d%*[^=]=%16s" -#define TRACE_IPIIRQ_FORMAT "%*[^[][%d] %*[^(](%32s" +#define TRACE_IPIIRQ_FORMAT "%*[^[][%d] %*[^(](%16s" #define TRACECMD_REPORT_FORMAT "%*[^]]] %lf:%*[^=]=%u%*[^=]=%d" #define TRACE_FORMAT "%*[^]]] %*s %lf:%*[^=]=%u%*[^=]=%d" |