diff options
author | petere <petere@0070b5ef-2f16-0410-befa-9a02bd1d6ddb> | 2011-11-26 23:21:33 +0000 |
---|---|---|
committer | petere <petere@0070b5ef-2f16-0410-befa-9a02bd1d6ddb> | 2011-11-26 23:21:33 +0000 |
commit | f5c471df7ec583c21d430b5c2e56563be408d0ef (patch) | |
tree | ed6678da2d3d85b48d5abb86e117e330df2120fb /debian/patches/format-security.patch | |
parent | 5de86d3b475e218dc1ca5ea4691f5cc48a5651f7 (diff) | |
download | ntp-f5c471df7ec583c21d430b5c2e56563be408d0ef.tar.gz |
Get build flags from dpkg-buildflags, and fix the resulting
-Wformat-security errors using patch from Colin Watson (closes:
#627403)
git-svn-id: svn://svn.debian.org/pkg-ntp/ntp/trunk@337 0070b5ef-2f16-0410-befa-9a02bd1d6ddb
Diffstat (limited to 'debian/patches/format-security.patch')
-rw-r--r-- | debian/patches/format-security.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/debian/patches/format-security.patch b/debian/patches/format-security.patch new file mode 100644 index 0000000..3175db6 --- /dev/null +++ b/debian/patches/format-security.patch @@ -0,0 +1,87 @@ +Description: Fix build failures with -Werror=format-security + The change to ntp_config.c is merely pacifying GCC, since signd_warning is + a constant string containing no '%' characters. In the other cases, it is + much more difficult to prove that the format string cannot contain any '%' + characters. +Author: Colin Watson <cjwatson@ubuntu.com> +Last-Update: 2011-05-20 + +Index: b/lib/isc/unix/ifiter_ioctl.c +=================================================================== +--- a/lib/isc/unix/ifiter_ioctl.c ++++ b/lib/isc/unix/ifiter_ioctl.c +@@ -159,7 +159,7 @@ + break; + } + if (iter->bufsize >= IFCONF_BUFSIZE_MAX) { +- UNEXPECTED_ERROR(__FILE__, __LINE__, ++ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", + isc_msgcat_get(isc_msgcat, + ISC_MSGSET_IFITERIOCTL, + ISC_MSG_BUFFERMAX, +@@ -260,7 +260,7 @@ + break; + } + if (iter->bufsize6 >= IFCONF_BUFSIZE_MAX) { +- UNEXPECTED_ERROR(__FILE__, __LINE__, ++ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", + isc_msgcat_get(isc_msgcat, + ISC_MSGSET_IFITERIOCTL, + ISC_MSG_BUFFERMAX, +Index: b/ntpd/ntp_config.c +=================================================================== +--- a/ntpd/ntp_config.c ++++ b/ntpd/ntp_config.c +@@ -2324,7 +2324,7 @@ + if ((RES_MSSNTP & flags) && !warned_signd) { + warned_signd = 1; + fprintf(stderr, "%s\n", signd_warning); +- msyslog(LOG_WARNING, signd_warning); ++ msyslog(LOG_WARNING, "%s", signd_warning); + } + } + } +Index: b/ntpd/ntp_control.c +=================================================================== +--- a/ntpd/ntp_control.c ++++ b/ntpd/ntp_control.c +@@ -2948,7 +2948,7 @@ + " %s", str); + } + NLOG(NLOG_SYSEVENT) +- msyslog(LOG_INFO, statstr); ++ msyslog(LOG_INFO, "%s", statstr); + } else { + + /* +@@ -2980,7 +2980,7 @@ + " %s", str); + } + NLOG(NLOG_PEEREVENT) +- msyslog(LOG_INFO, statstr); ++ msyslog(LOG_INFO, "%s", statstr); + } + record_proto_stats(statstr); + #if DEBUG +Index: b/ntpd/ntpd.c +=================================================================== +--- a/ntpd/ntpd.c ++++ b/ntpd/ntpd.c +@@ -1283,7 +1283,7 @@ + + msyslog(LOG_ERR, "%s:%d: fatal error:", file, line); + vsnprintf(errbuf, sizeof(errbuf), format, args); +- msyslog(LOG_ERR, errbuf); ++ msyslog(LOG_ERR, "%s", errbuf); + msyslog(LOG_ERR, "exiting (due to fatal error in library)"); + + abort(); +@@ -1305,7 +1305,7 @@ + + msyslog(LOG_ERR, "%s:%d: unexpected error:", file, line); + vsnprintf(errbuf, sizeof(errbuf), format, args); +- msyslog(LOG_ERR, errbuf); ++ msyslog(LOG_ERR, "%s", errbuf); + + if (++unexpected_error_cnt == MAX_UNEXPECTED_ERRORS) + { |