From: Karel Zak Date: Mon, 29 Nov 2021 14:32:27 +0000 (+0100) Subject: irqtop: don't ignore sscanf() return code [coverity scan] X-Git-Tag: v2.38-rc1~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b86ed62409ea653cbb618f51755846c9f120c8c0;p=thirdparty%2Futil-linux.git irqtop: don't ignore sscanf() return code [coverity scan] Signed-off-by: Karel Zak --- diff --git a/sys-utils/irq-common.c b/sys-utils/irq-common.c index 3506753947..aa10f7e05b 100644 --- a/sys-utils/irq-common.c +++ b/sys-utils/irq-common.c @@ -290,7 +290,8 @@ static struct irq_stat *get_irqinfo(int softirq) for (index = 0; (index < stat->nr_active_cpu) && (tmp - line < length); index++) { struct irq_cpu *cpu = &stat->cpus[index]; - sscanf(tmp, " %10lu", &count); + if (sscanf(tmp, " %10lu", &count) != 1) + continue; curr->total += count; cpu->total += count; stat->total_irq += count;