[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190319025755.15394-1-tsu.yubo@gmail.com>
Date: Mon, 18 Mar 2019 22:57:55 -0400
From: Bo YU <tsu.yubo@...il.com>
To: l.stach@...gutronix.de, linux+etnaviv@...linux.org.uk,
christian.gmeiner@...il.com, airlied@...ux.ie, daniel@...ll.ch,
etnaviv@...ts.freedesktop.org
Cc: Bo YU <tsu.yubo@...il.com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, yuzibode@....com
Subject: [PATCH] drm: etnaviv: fix strncpy sizeof argument
Calling strncpy with a maximum size argument of 64 bytes on destination
array "domain->name" of size 64 bytes might leave the destination string
unterminated.
Detected by CoverityScan, CID# 1443992: Memory - illegal accesses
(BUFFER_SIZE_WARNING)
Fixes: 9e2c2e2730126 (drm/etnaviv: add infrastructure to query perf counter)
Signed-off-by: Bo YU <tsu.yubo@...il.com>
---
drivers/gpu/drm/etnaviv/etnaviv_perfmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c
index 4227a4006c34..08ca3c44be48 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c
@@ -414,7 +414,7 @@ int etnaviv_pm_query_dom(struct etnaviv_gpu *gpu,
domain->id = domain->iter;
domain->nr_signals = dom->nr_signals;
- strncpy(domain->name, dom->name, sizeof(domain->name));
+ strncpy(domain->name, dom->name, sizeof(dom->name));
domain->iter++;
if (domain->iter == meta->nr_domains)
--
2.11.0
Powered by blists - more mailing lists