summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e40acb8)
raw | patch | inline | side by side (parent: e40acb8)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 5 May 2009 21:02:23 +0000 (23:02 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 5 May 2009 21:04:57 +0000 (23:04 +0200) |
This is an upstream patch to fix dereferencing of a type-punned pointer
identified by GCC 4.4 (thanks to Martin Michlmayr for reporting this).
Closes: #526667
identified by GCC 4.4 (thanks to Martin Michlmayr for reporting this).
Closes: #526667
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/ntpd_type_pun_fix.dpatch | [new file with mode: 0644] | patch | blob |
diff --git a/debian/changelog b/debian/changelog
index 7d1da0df36ed1a6b6008f93b1fa3ecbef15c9792..d1ffa1feaba29c37894a6413c7667ff0effebece 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
- Added battery_acpi_complain.dpatch - upstream patch to fix excessive
error messages in the battery plugin in case /proc/acpi/battery is not
available.
+ - Added ntpd_type_pun_fix.dpatch - upstream patch to fix dereferencing of
+ a type-punned pointer identified by GCC 4.4, thanks to Martin Michlmayr
+ for reporting this (Closes: #526667).
* debian/collectd.conf, debian/filters.conf:
- Added a sample filter chain configuration.
* debian/rules:
libiptc which is available as shared library since iptables 1.4.3.
Depend on versions >= 1.4.3.2-2 because of #524766.
- -- Sebastian Harl <sh@tokkee.org> Mon, 20 Apr 2009 22:52:56 +0200
+ -- Sebastian Harl <sh@tokkee.org> Tue, 05 May 2009 22:59:33 +0200
collectd (4.6.2-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index aa14973a193e91625968cb11cb2fb96ea8fb3d34..63040b338196c0e14bdfa7307954242a9d4bae05 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
rrd_filter_path.dpatch
collection_conf_path.dpatch
battery_acpi_complain.dpatch
+ntpd_type_pun_fix.dpatch
diff --git a/debian/patches/ntpd_type_pun_fix.dpatch b/debian/patches/ntpd_type_pun_fix.dpatch
--- /dev/null
@@ -0,0 +1,56 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## ntpd_type_pun_fix.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: ntpd plugin: Fix dereference of type-punned pointer.
+
+@DPATCH@
+
+diff a/src/ntpd.c b/src/ntpd.c
+--- a/src/ntpd.c
++++ b/src/ntpd.c
+@@ -896,25 +896,33 @@ static int ntpd_read (void)
+
+ if (ptr->v6_flag)
+ {
+- struct sockaddr_in6 *sa_ptr;
+- sa_ptr = (struct sockaddr_in6 *) &sa;
++ struct sockaddr_in6 sa6;
+
+- sa_ptr->sin6_family = AF_INET6;
+- sa_ptr->sin6_port = htons (123);
+- memcpy (&sa_ptr->sin6_addr, &ptr->srcadr6,
++ assert (sizeof (sa) >= sizeof (sa6));
++
++ memset (&sa6, 0, sizeof (sa6));
++ sa6.sin6_family = AF_INET6;
++ sa6.sin6_port = htons (123);
++ memcpy (&sa6.sin6_addr, &ptr->srcadr6,
+ sizeof (struct in6_addr));
+- sa_len = sizeof (struct sockaddr_in6);
++ sa_len = sizeof (sa6);
++
++ memcpy (&sa, &sa6, sizeof (sa6));
+ }
+ else
+ {
+- struct sockaddr_in *sa_ptr;
+- sa_ptr = (struct sockaddr_in *) &sa;
++ struct sockaddr_in sa4;
+
+- sa_ptr->sin_family = AF_INET;
+- sa_ptr->sin_port = htons (123);
+- memcpy (&sa_ptr->sin_addr, &ptr->srcadr,
++ assert (sizeof (sa) >= sizeof (sa4));
++
++ memset (&sa4, 0, sizeof (sa4));
++ sa4.sin_family = AF_INET;
++ sa4.sin_port = htons (123);
++ memcpy (&sa4.sin_addr, &ptr->srcadr,
+ sizeof (struct in_addr));
+- sa_len = sizeof (struct sockaddr_in);
++ sa_len = sizeof (sa4);
++
++ memcpy (&sa, &sa4, sizeof (sa4));
+ }
+
+ if (do_reverse_lookups == 0)