From: Jesse Natalie Date: Mon, 28 Dec 2020 18:44:08 +0000 (-0800) Subject: microsoft/compiler: Fix incorrect size passed to strncpy X-Git-Tag: upstream/21.0.0~851 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd97f401dc8ec76e717862c654a6ae29fcb93292;p=platform%2Fupstream%2Fmesa.git microsoft/compiler: Fix incorrect size passed to strncpy GCC correctly detects/warns that this was the wrong size Fixes: b9c61379 ("microsoft/compiler: translate nir to dxil") Reviewed-by: Adam Jackson Part-of: --- diff --git a/src/microsoft/compiler/dxil_signature.c b/src/microsoft/compiler/dxil_signature.c index 9cd94b9..e44b16e 100644 --- a/src/microsoft/compiler/dxil_signature.c +++ b/src/microsoft/compiler/dxil_signature.c @@ -163,7 +163,7 @@ get_semantic_sv_name(nir_variable *var, struct semantic_info *info) default: unreachable("unsupported system value"); } - strncpy(info->name, var->name, 64); + strncpy(info->name, var->name, ARRAY_SIZE(info->name) - 1); } static void