Commit 1a816849 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'supermuc_fix' into 'master'

Add fixes for -Wformat-security warnings.

This doesn't allow non-string literals as formats, these may include format specifiers and can cause buffer overruns, maybe. Seen on Ubuntu.

See merge request !69
parents a6438b2f 2cda534d
......@@ -37,9 +37,9 @@ const char *git_revision(void) {
static const char *revision = GIT_REVISION;
if(!initialised) {
if(strlen(revision) == 0)
sprintf(buf, "Unknown");
sprintf(buf, "%s", "unknown");
else
sprintf(buf, revision);
sprintf(buf, "%s", revision);
initialised = 1;
}
return buf;
......@@ -56,9 +56,9 @@ const char *git_branch(void) {
static const char *branch = GIT_BRANCH;
if(!initialised) {
if(strlen(branch) == 0)
sprintf(buf, "Unknown");
sprintf(buf, "%s", "unknown");
else
sprintf(buf, branch);
sprintf(buf, "%s", branch);
initialised = 1;
}
return buf;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment