From ca9174d31757d36218c62a284145ebb3c81798da Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Tue, 9 Jun 2020 17:18:36 -0700 Subject: [PATCH] Fix strncpy warning by making it more obviously dangerous The function as a whole is boundschecked after the fact, but as its comments state, this function really needs its API changed to carry buffer lengths in from the outside. --- sc2/src/uqm/commglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc2/src/uqm/commglue.c b/sc2/src/uqm/commglue.c index d6b79ea78..a7b514ccb 100644 --- a/sc2/src/uqm/commglue.c +++ b/sc2/src/uqm/commglue.c @@ -284,7 +284,7 @@ construct_response (UNICODE *buf, int R /* promoted from RESPONSE_REF */, ...) if (name) { len = strlen (name); - strncpy (buf, name, len); + strcpy (buf, name); buf += len; /*