From 18cf14b888223972cb7fcadddcb2a8ae2010bd7c Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Fri, 31 Aug 2018 12:56:33 +0200 Subject: [PATCH] To be on the safe side, check the result of realpath(). --- midizap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midizap.c b/midizap.c index c33eb87..b95dab8 100644 --- a/midizap.c +++ b/midizap.c @@ -1548,7 +1548,7 @@ static char *absolute_path(char *name) char *path = malloc(strlen(pwd)+strlen(name)+2); static char abspath[PATH_MAX]; sprintf(path, "%s/%s", pwd, name); - realpath(path, abspath); + if (!realpath(path, abspath)) strcpy(abspath, path); free(path); free(pwd); return abspath; }