Skip to content
Snippets Groups Projects
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
Branches
Tags
1 merge request!136Master
...@@ -37,9 +37,9 @@ const char *git_revision(void) { ...@@ -37,9 +37,9 @@ const char *git_revision(void) {
static const char *revision = GIT_REVISION; static const char *revision = GIT_REVISION;
if(!initialised) { if(!initialised) {
if(strlen(revision) == 0) if(strlen(revision) == 0)
sprintf(buf, "Unknown"); sprintf(buf, "%s", "unknown");
else else
sprintf(buf, revision); sprintf(buf, "%s", revision);
initialised = 1; initialised = 1;
} }
return buf; return buf;
...@@ -56,9 +56,9 @@ const char *git_branch(void) { ...@@ -56,9 +56,9 @@ const char *git_branch(void) {
static const char *branch = GIT_BRANCH; static const char *branch = GIT_BRANCH;
if(!initialised) { if(!initialised) {
if(strlen(branch) == 0) if(strlen(branch) == 0)
sprintf(buf, "Unknown"); sprintf(buf, "%s", "unknown");
else else
sprintf(buf, branch); sprintf(buf, "%s", branch);
initialised = 1; initialised = 1;
} }
return buf; return buf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment