From 0902dbdd398c6d344cda44843566786aaed39ec2 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 21 Jul 2020 01:09:48 -0700 Subject: [PATCH] Test: Fix crash if directory doesn't resolve --- src/platform/test/cinema-main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform/test/cinema-main.c b/src/platform/test/cinema-main.c index 29c10c452..2a9206f65 100644 --- a/src/platform/test/cinema-main.c +++ b/src/platform/test/cinema-main.c @@ -767,8 +767,10 @@ int main(int argc, char** argv) { } #ifndef _WIN32 char* rbase = realpath(base, NULL); - strncpy(base, rbase, PATH_MAX); - free(rbase); + if (rbase) { + strncpy(base, rbase, PATH_MAX); + free(rbase); + } #endif struct CInemaTestList tests;