public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/libspf2/files/, mail-filter/libspf2/
Date: Fri, 21 Feb 2025 19:42:47 +0000 (UTC)	[thread overview]
Message-ID: <1740166891.b9117143f6602a3abbe3261f55b13b90e2298733.grobian@gentoo> (raw)

commit:     b9117143f6602a3abbe3261f55b13b90e2298733
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 21 19:41:31 2025 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Feb 21 19:41:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9117143

mail-filter/libspf2-1.2.11-r1: add upstream integer underflow patch

As suggested by hanno, seems like a good idea to have to fix in any
case.

Bug: https://bugs.gentoo.org/916493
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 .../files/libspf2-1.2.11-integer-underflow.patch   | 26 +++++++++++
 mail-filter/libspf2/libspf2-1.2.11-r1.ebuild       | 51 ++++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/mail-filter/libspf2/files/libspf2-1.2.11-integer-underflow.patch b/mail-filter/libspf2/files/libspf2-1.2.11-integer-underflow.patch
new file mode 100644
index 000000000000..fabfd6ceacfd
--- /dev/null
+++ b/mail-filter/libspf2/files/libspf2-1.2.11-integer-underflow.patch
@@ -0,0 +1,26 @@
+From d14abff4b544cfc53a8b5ef54cbc2353866b5081 Mon Sep 17 00:00:00 2001
+From: Simon Arlott <sa.me.uk>
+Date: Sat, 30 Sep 2023 12:18:51 +0100
+Subject: [PATCH] Fix integer underflow
+
+---
+ src/libspf2/spf_compile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/libspf2/spf_compile.c b/src/libspf2/spf_compile.c
+index b08ffe2..d401028 100644
+--- a/src/libspf2/spf_compile.c
++++ b/src/libspf2/spf_compile.c
+@@ -455,7 +455,11 @@ SPF_c_parse_var(SPF_response_t *spf_response, SPF_data_var_t *data,
+ 			/* Magic numbers for x/Nc in gdb. */					\
+ 			data->ds.__unused0 = 0xba; data->ds.__unused1 = 0xbe;	\
+ 			dst = SPF_data_str( data );								\
+-			ds_avail = _avail - sizeof(SPF_data_t);					\
++			if ((_avail) < sizeof(SPF_data_t))						\
++				return SPF_response_add_error_ptr(spf_response,		\
++									SPF_E_BIG_STRING, NULL, src,	\
++								"Out of memory for string literal");\
++			ds_avail = (_avail) - sizeof(SPF_data_t);				\
+ 			ds_len = 0;												\
+ 		} while(0)
+ 

diff --git a/mail-filter/libspf2/libspf2-1.2.11-r1.ebuild b/mail-filter/libspf2/libspf2-1.2.11-r1.ebuild
new file mode 100644
index 000000000000..b215671557ff
--- /dev/null
+++ b/mail-filter/libspf2/libspf2-1.2.11-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools
+
+GHASH=4915c308d57ff3abac9fb241f09c4bed2ab54815  # 1.2.11
+DESCRIPTION="implementation of Sender Policy Framework (SPF)"
+HOMEPAGE="https://www.libspf2.net/"
+SRC_URI="https://github.com/shevek/${PN}/archive/${GHASH}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="|| ( LGPL-2.1 BSD-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.2.11-memset-include-string-h.patch
+	"${FILESDIR}"/${PN}-1.2.11-undefined-dn_.patch
+	"${FILESDIR}"/${PN}-1.2.11-musl.patch
+	"${FILESDIR}"/${PN}-1.2.11-integer-underflow.patch
+)
+
+S=${WORKDIR}/${PN}-${GHASH}
+
+src_prepare() {
+	default
+
+	sed -i -e '/bin_PROGRAMS/s/spfquery_static//' src/spfquery/Makefile.am \
+		-e '/bin_PROGRAMS/s/spftest_static//' src/spftest/Makefile.am \
+		-e '/bin_PROGRAMS/s/spfd_static//' src/spfd/Makefile.am \
+		-e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am \
+		|| die
+
+	sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac || die
+
+	sed -i -e '/AX_WITH_PERL/d' configure.ac || die # bug 885055
+
+	eautoreconf
+}
+
+src_configure() {
+	econf --disable-static
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+	dodoc README TODO INSTALL
+
+	find "${ED}" -name '*.la' -delete || die
+}


             reply	other threads:[~2025-02-21 19:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 19:42 Fabian Groffen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-26 20:55 [gentoo-commits] repo/gentoo:master commit in: mail-filter/libspf2/files/, mail-filter/libspf2/ Fabian Groffen
2021-12-17 12:06 Fabian Groffen
2021-10-25 17:22 Fabian Groffen
2021-04-19 19:12 Sam James
2017-09-08 11:24 Fabian Groffen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1740166891.b9117143f6602a3abbe3261f55b13b90e2298733.grobian@gentoo \
    --to=grobian@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox