diff --git a/gfx/drivers/drm_gfx.c b/gfx/drivers/drm_gfx.c index f7a6f158a0..320758236b 100644 --- a/gfx/drivers/drm_gfx.c +++ b/gfx/drivers/drm_gfx.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -377,7 +378,7 @@ static void drm_format_name(const unsigned int fourcc, char *format_str) for (i = 0; i < ARRAY_SIZE(format_info); i++) { if (format_info[i].format == fourcc) - strcpy(format_str, format_info[i].name); + strlcpy(format_str, format_info[i].name, sizeof(format_str)); } } diff --git a/gfx/drivers_context/osmesa_ctx.c b/gfx/drivers_context/osmesa_ctx.c index fdeacc8ba8..c660fcde04 100644 --- a/gfx/drivers_context/osmesa_ctx.c +++ b/gfx/drivers_context/osmesa_ctx.c @@ -25,6 +25,8 @@ #include #include +#include + #include #include "../../runloop.h" @@ -73,7 +75,7 @@ static void osmesa_fifo_open(gfx_ctx_osmesa_data_t *osmesa) saun.sun_family = AF_UNIX; - strcpy(saun.sun_path, g_osmesa_fifo); + strlcpy(saun.sun_path, g_osmesa_fifo, sizeof(saun.sun_path)); unlink(g_osmesa_fifo);