From: Junio C Hamano Date: Wed, 17 Feb 2016 18:13:32 +0000 (-0800) Subject: Merge branch 'jk/test-path-utils-xsnprintf' X-Git-Tag: v2.8.0-rc0~50 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/790dd332c6986693b731211e49479c74c8a1894c?hp=c37f9a1bc38cad56c9eca40014802e7cd822c21c Merge branch 'jk/test-path-utils-xsnprintf' Some calls to strcpy(3) triggers a false warning from static analysers that are less intelligent than humans, and reducing the number of these false hits helps us notice real issues. A few calls to strcpy(3) in test-path-utils that are already safe has been rewritten to avoid false wanings. * jk/test-path-utils-xsnprintf: test-path-utils: use xsnprintf in favor of strcpy --- diff --git a/test-path-utils.c b/test-path-utils.c index c3adcd87b8..6232dfe661 100644 --- a/test-path-utils.c +++ b/test-path-utils.c @@ -56,7 +56,7 @@ static int test_function(struct test_data *data, char *(*func)(char *input), if (!data[i].from) to = func(NULL); else { - strcpy(buffer, data[i].from); + xsnprintf(buffer, sizeof(buffer), "%s", data[i].from); to = func(buffer); } if (!strcmp(to, data[i].to))