Code

patches: Added format-security; fixing a missing printf-style format argument.
authorSebastian Harl <sh@teamix.net>
Thu, 24 Jan 2013 15:06:06 +0000 (16:06 +0100)
committerSebastian Harl <sh@teamix.net>
Thu, 24 Jan 2013 15:06:06 +0000 (16:06 +0100)
debian/changelog
debian/patches/format-security [new file with mode: 0644]
debian/patches/series

index c0097626476ece8637cd17fa6b64b69dc41cabcd..262264b06c1ab764d409ef9b5237c61c15cc0a8c 100644 (file)
@@ -17,6 +17,7 @@ pnp4nagios (0.6.19-1) UNRELEASED; urgency=low
       (cf. #684420).
   * debian/patches:
     - fix-npcd-path updated for 0.6.19.
+    - Added format-security; fixing a missing printf-style format argument.
   * debian/rules:
     - Manually clean-up auto-generated scripts/rrd_modify.pl.
   * debian/icinga-module.cfg, debian/rules:
diff --git a/debian/patches/format-security b/debian/patches/format-security
new file mode 100644 (file)
index 0000000..5de4e84
--- /dev/null
@@ -0,0 +1,18 @@
+Description: Fixed a missing printf-style format argument.
+ This was identified by GCC's format-security check which forbids any non
+ string literals to be used as format argument.
+Author: Sebastian Harl <tokkee@debian.org>
+Forwarded: yes
+
+diff a/src/logging.c b/src/logging.c
+--- a/src/logging.c
++++ b/src/logging.c
+@@ -27,7 +27,7 @@ extern int max_logfile_size;
+ int do_log(char *message) {
+       if (use_syslog) {
+-              syslog(LOG_NOTICE, message);
++              syslog(LOG_NOTICE, "%s", message);
+               return OK;
+       } else if (use_syslog == FALSE) {
+               if (write_log(message)==0)
index 78f6972ac54b037bcbb4ea03406f5d82c208c820..c7605878415b7fe8e645b41762be9481e5d94117 100644 (file)
@@ -3,3 +3,4 @@ apache-fix-path-to-userfile
 fix-npcd-path
 fix-nagios-url
 adjust-template-path
+format-security