From: Ilia Mirkin Date: Thu, 26 Mar 2015 23:37:50 +0000 (-0400) Subject: gallium/hud: avoid overflowing hud graph name size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e34faaf06f50741164209cc5743ab4d8579c94c;p=mesa.git gallium/hud: avoid overflowing hud graph name size Spotted by Coverity. Signed-off-by: Ilia Mirkin Reviewed-by: Marek Olšák --- diff --git a/src/gallium/auxiliary/hud/hud_driver_query.c b/src/gallium/auxiliary/hud/hud_driver_query.c index b48708c2fe6..53771fcae9d 100644 --- a/src/gallium/auxiliary/hud/hud_driver_query.c +++ b/src/gallium/auxiliary/hud/hud_driver_query.c @@ -157,7 +157,8 @@ hud_pipe_query_install(struct hud_pane *pane, struct pipe_context *pipe, if (!gr) return; - strcpy(gr->name, name); + strncpy(gr->name, name, sizeof(gr->name)); + gr->name[sizeof(gr->name) - 1] = '\0'; gr->query_data = CALLOC_STRUCT(query_info); if (!gr->query_data) { FREE(gr);