diff options
author | Matthieu Herrb <matthieu@herrb.eu> | 2018-10-23 21:29:09 +0200 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2018-10-25 09:18:06 -0400 |
commit | da15c7413916f754708c62c2089265528cd661e2 (patch) | |
tree | 8af4ff69b5b1f7a614646e7d3b5d81b6e7589ba3 | |
parent | 8a59e3b7dbb30532a7c3769c555e00d7c4301170 (diff) |
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 <matthieu@herrb.eu>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 248d164eae27f1f310266d78e52f13f64362f81e)
-rw-r--r-- | os/log.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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"); |