1From d84807ec6d6f8511e4ec939a745d4d7bb35c3cfb Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Fri, 4 Feb 2022 09:22:48 -0800 4Subject: [PATCH] tracers: Fix buffer overflow 5 6Fixes 7| ../../../git/plugins/tracers/gstcpuusagecompute.c:106:9: error: 'fscanf' may overflow; destination buffer in argument 3 has size 8, but the corresponding specifier may require size 9 [-Werror,-Wfortify-sour 8ce] 9| cpu_name, &user[0], &nice[0], &system[0], &idle[0], &iowait, &irq, 10| ^ 11 12Upstream-Status: Pending 13Signed-off-by: Khem Raj <raj.khem@gmail.com> 14--- 15 plugins/tracers/gstcpuusagecompute.c | 2 +- 16 1 file changed, 1 insertion(+), 1 deletion(-) 17 18diff --git a/plugins/tracers/gstcpuusagecompute.c b/plugins/tracers/gstcpuusagecompute.c 19index 39255fb..00bae66 100644 20--- a/plugins/tracers/gstcpuusagecompute.c 21+++ b/plugins/tracers/gstcpuusagecompute.c 22@@ -69,7 +69,7 @@ gst_cpu_usage_compute (GstCPUUsage * cpu_usage) 23 gint *idle; 24 gint *idle_aux; 25 26- gchar cpu_name[CPU_NAME_MAX_SIZE]; 27+ gchar cpu_name[CPU_NAME_MAX_SIZE+1]; 28 gint iowait; /* Time waiting for I/O to complete */ 29 gint irq; /* Time servicing interrupts */ 30 gint softirq; /* Time servicing softirqs */ 31-- 322.35.1 33 34