Switch to using strncopy to avoid potential overflow of
name array in struct hud_graph.

Coverity-id: 1413761

Signed-off-by: Robert Foss <[email protected]>
---
 src/gallium/auxiliary/hud/hud_cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/hud/hud_cpu.c 
b/src/gallium/auxiliary/hud/hud_cpu.c
index 4caaab6977..468c36207b 100644
--- a/src/gallium/auxiliary/hud/hud_cpu.c
+++ b/src/gallium/auxiliary/hud/hud_cpu.c
@@ -362,7 +362,7 @@ void hud_thread_counter_install(struct hud_pane *pane, 
const char *name,
    if (!gr)
       return;
 
-   strcpy(gr->name, name);
+   strncpy(gr->name, name, HUD_GRAPH_NAME_LEN);
 
    gr->query_data = CALLOC_STRUCT(counter_info);
    if (!gr->query_data) {
-- 
2.11.0

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to