diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-03-26 19:37:50 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-03-26 21:02:08 -0400 |
commit | 2e34faaf06f50741164209cc5743ab4d8579c94c (patch) | |
tree | 403109aeb418fd835629bcfc01af94fa32220ab5 /src/gallium/auxiliary/hud/hud_driver_query.c | |
parent | 9d1b5febb62d74c9fc564635d4e0fa5207928c46 (diff) | |
download | external_mesa3d-2e34faaf06f50741164209cc5743ab4d8579c94c.zip external_mesa3d-2e34faaf06f50741164209cc5743ab4d8579c94c.tar.gz external_mesa3d-2e34faaf06f50741164209cc5743ab4d8579c94c.tar.bz2 |
gallium/hud: avoid overflowing hud graph name size
Spotted by Coverity.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_driver_query.c')
-rw-r--r-- | src/gallium/auxiliary/hud/hud_driver_query.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/hud/hud_driver_query.c b/src/gallium/auxiliary/hud/hud_driver_query.c index b48708c..53771fc 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); |