From f853de37b9969afc7ccd145f6e7f06cf9e76a3eb Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 17 Mar 2021 18:11:45 -0700 Subject: [PATCH] CInema: Fix glob anchoring --- src/platform/test/cinema-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/test/cinema-main.c b/src/platform/test/cinema-main.c index a36b495c3..312073a71 100644 --- a/src/platform/test/cinema-main.c +++ b/src/platform/test/cinema-main.c @@ -415,7 +415,7 @@ static bool globTests(struct CInemaTestList* tests, const char* glob, const char } else if (next[0] == '.') { char subtest[MAX_TEST]; if (!ancestors) { - strncpy(subtest, glob, next - glob); + strlcpy(subtest, glob, next - glob + 1); } else { size_t len = strlen(ancestors) + (next - glob) + 2; if (len > sizeof(subtest)) {