Skip to content

Commit

Permalink
Mitigate format string exploits
Browse files Browse the repository at this point in the history
error: format not a string literal and no format arguments
[-Werror=format-security]

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1189 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
  • Loading branch information
jmccrohan committed May 19, 2012
1 parent b0fd4a3 commit 0070c29
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drv_PHAnderson.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static int drv_PHAnderson_start(const char *section)
}

s = cfg_get(section, "Bootscreen", NULL);
printf(s);
printf("%s", s);
drv_PHAnderson_bootscreen(s);

drv_PHAnderson_clear(); /* clear display */
Expand Down
2 changes: 1 addition & 1 deletion drv_SamsungSPF.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ int drv_SamsungSPF_list(void)

printf("SamsungSPF driver, supported models [");
for (i = 0; i < numFrames; i++) {
printf(spfDevices[i].type);
printf("%s", spfDevices[i].type);
if (i < numFrames - 1)
printf(", ");
}
Expand Down
6 changes: 3 additions & 3 deletions plugin_button_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ static void my_button_exec(RESULT * result, int argc, RESULT * argv[])

signal(SIGCHLD, SIG_IGN);
prog = R2S(argv[0]);
info(prog);
info("%s", prog);
for (i = 1; i < argc; i++) {
arg = R2S(argv[i]);
args[i] = arg;
info(arg);
info("%s", arg);
}
args[0] = prog;
args[i] = (char *) 0;
Expand All @@ -82,7 +82,7 @@ static void my_button_exec(RESULT * result, int argc, RESULT * argv[])
execvp(prog, args);
errsv = errno;
info("executing program failed");
info(strerror(errsv));
info("%s", strerror(errsv));
exit(0);
} else if (pid == -1) {
info("weird error has occurred. couldn't fork.");
Expand Down

0 comments on commit 0070c29

Please sign in to comment.