Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/queue.c: fix format-security warnings #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orlitzky
Copy link
Contributor

The syslog() function takes as its second argument a format string (a la printf), but if the third parameter is a string, then the format string can be omitted. This has led to security vulnerabilities in the past, and compilers can now warn about it. In particular, GCC has the -Wformat-security option, which can be made an error with -Werror=format-security.

A few such two-argument calls were present in src/queue.c, where constant strings were being logged to syslog. This commit adds the second format string parameter (simply "%s" in this case) to avoid the compiler warnings.

More information about format-security can be found in Fedora's FAQ

…tring.

The syslog() function takes as its second argument a format string (a
la printf), but if the third parameter is a string, then the format
string can be omitted. This has led to security vulnerabilities in the
past, and compilers can now warn about it. In particular, GCC has the
-Wformat-security option, which can be made an error with
-Werror=format-security.

A few such two-argument calls were present in src/queue.c, where
constant strings were being logged to syslog. This commit adds the
second format string parameter (simply "%s" in this case) to avoid the
compiler warnings.

More information about format-security can be found in Fedora's FAQ:

  https://fedoraproject.org/wiki/Format-Security-FAQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant