From 248d164eae27f1f310266d78e52f13f64362f81e Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Tue, 23 Oct 2018 21:29:09 +0200 Subject: [PATCH] LogFilePrep: add a comment to the unsafe format string. CVE-2018-14665 also made it possible to exploit this to access memory. With -logfile forbidden when running with elevated privileges this is no longer an issue. Signed-off-by: Matthieu Herrb Reviewed-by: Adam Jackson --- os/log.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/log.c b/os/log.c index 8576955fc..fd433e62f 100644 --- a/os/log.c +++ b/os/log.c @@ -194,6 +194,8 @@ LogFilePrep(const char *fname, const char *backup, const char *idstring) { char *logFileName = NULL; + /* the format string below is controlled by the user, + this code should never be called with elevated privileges */ if (asprintf(&logFileName, fname, idstring) == -1) FatalError("Cannot allocate space for the log file name\n");