public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/, mail-filter/rspamd/files/
Date: Tue,  7 Sep 2021 20:25:25 +0000 (UTC)	[thread overview]
Message-ID: <1631046227.066a3f86023d2329d692558e9f869fc892071d96.sam@gentoo> (raw)

commit:     066a3f86023d2329d692558e9f869fc892071d96
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Mon Sep  6 06:42:00 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep  7 20:23:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=066a3f86

mail-filter/rspamd: backport null dereference fix

This Backports patch which fixes possible runtime segfaults caused by
null pointer dereference.

Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/rspamd-3.0-fix-null-dereference.patch    | 46 ++++++++++++++++++++++
 mail-filter/rspamd/rspamd-3.0-r2.ebuild            |  1 +
 2 files changed, 47 insertions(+)

diff --git a/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch b/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch
new file mode 100644
index 00000000000..d355f701a27
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch
@@ -0,0 +1,46 @@
+From abea3ac21f764658a966dad475fc99e4b79530d7 Mon Sep 17 00:00:00 2001
+From: Jan Smutny <js@excello.cz>
+Date: Tue, 31 Aug 2021 14:25:23 +0200
+Subject: [PATCH] [Fix] src/lua/lua_mimepart.c: fix null dereference
+
+---
+
+This patch is taken from upstream. It fixes possible runtime segfaults.
+
+PR: https://github.com/rspamd/rspamd/pull/3873
+
+diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c
+index 66b588e3a..21a46d496 100644
+--- a/src/lua/lua_mimepart.c
++++ b/src/lua/lua_mimepart.c
+@@ -1240,7 +1240,16 @@ lua_textpart_get_fuzzy_hashes (lua_State * L)
+ 	rspamd_stat_token_t *word;
+ 	struct lua_shingle_filter_cbdata cbd;
+ 
+-	if (part && pool) {
++
++	if (part == NULL || pool == NULL) {
++		return luaL_error (L, "invalid arguments");
++	}
++
++	if (IS_TEXT_PART_EMPTY (part) || part->utf_words == NULL) {
++		lua_pushnil (L);
++		lua_pushnil (L);
++	}
++	else {
+ 		/* TODO: add keys and algorithms support */
+ 		rspamd_cryptobox_hash (key, "rspamd", strlen ("rspamd"), NULL, 0);
+ 
+@@ -1294,9 +1303,6 @@ lua_textpart_get_fuzzy_hashes (lua_State * L)
+ 			}
+ 		}
+ 	}
+-	else {
+-		return luaL_error (L, "invalid arguments");
+-	}
+ 
+ 	return 2;
+ }
+-- 
+2.31.1
+

diff --git a/mail-filter/rspamd/rspamd-3.0-r2.ebuild b/mail-filter/rspamd/rspamd-3.0-r2.ebuild
index efe18dc57b0..30065ff095b 100644
--- a/mail-filter/rspamd/rspamd-3.0-r2.ebuild
+++ b/mail-filter/rspamd/rspamd-3.0-r2.ebuild
@@ -60,6 +60,7 @@ BDEPEND="
 PATCHES=(
 	"${FILESDIR}/${P}-cmake-lua-version.patch"
 	"${FILESDIR}/${P}-system-libfmt.patch"
+	"${FILESDIR}/${P}-fix-null-dereference.patch"
 	"${FILESDIR}/${PN}-2.6-unbundle-lua.patch"
 	"${FILESDIR}/${PN}-2.5-unbundle-snowball.patch"
 )


             reply	other threads:[~2021-09-07 20:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 20:25 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-02 17:44 [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/, mail-filter/rspamd/files/ Petr Vaněk
2024-07-13 20:43 Petr Vaněk
2024-03-13 17:32 Petr Vaněk
2023-12-03 22:01 Petr Vaněk
2023-08-07 17:22 Sam James
2023-08-07  5:43 Sam James
2022-11-15  0:56 Sam James
2022-11-06  6:17 Sam James
2022-04-12  8:20 Sam James
2021-09-07 20:25 Sam James
2021-08-22  2:50 Sam James
2020-10-08 19:41 Sam James
2020-04-04  8:06 Joonas Niilola
2020-02-24  5:55 Joonas Niilola
2019-12-14  8:41 Joonas Niilola
2019-11-04 11:22 Dirkjan Ochtman
2018-03-11 14:07 Dirkjan Ochtman
2017-06-13 19:52 Dirkjan Ochtman
2016-09-10 14:56 Dirkjan Ochtman
2016-04-26 19:33 Dirkjan Ochtman
2016-01-13 16:30 Dirkjan Ochtman

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=1631046227.066a3f86023d2329d692558e9f869fc892071d96.sam@gentoo \
    --to=sam@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