summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2024-02-01 07:54:16 -0500
committerMichael Orlitzky <mjo@gentoo.org>2024-02-01 07:54:16 -0500
commitb485329f34dcbaa270e68b2715bcab11b7104313 (patch)
treee1a616e74d3e47f70045532602765d6675fea6b8 /dev-gap
parentdev-python/mkdocs-minify-plugin: add 0.8.0 (diff)
downloadgentoo-b485329f34dcbaa270e68b2715bcab11b7104313.tar.gz
gentoo-b485329f34dcbaa270e68b2715bcab11b7104313.tar.bz2
gentoo-b485329f34dcbaa270e68b2715bcab11b7104313.zip
dev-gap/io: backport fix for assertion failure
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'dev-gap')
-rw-r--r--dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch35
-rw-r--r--dev-gap/io/io-4.8.2-r1.ebuild (renamed from dev-gap/io/io-4.8.2.ebuild)3
2 files changed, 38 insertions, 0 deletions
diff --git a/dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch b/dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch
new file mode 100644
index 000000000000..059cc3387b2b
--- /dev/null
+++ b/dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch
@@ -0,0 +1,35 @@
+From edfbed91b1c98abbed7c57463b88a1e8e134f2c3 Mon Sep 17 00:00:00 2001
+From: Chris Jefferson <caj21@st-andrews.ac.uk>
+Date: Wed, 24 Jan 2024 11:18:09 +0800
+Subject: [PATCH] Check arguments to IO_gmtime and IO_localtime
+
+---
+ src/io.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/io.c b/src/io.c
+index 731880e..2a1536e 100644
+--- a/src/io.c
++++ b/src/io.c
+@@ -1777,6 +1777,10 @@ static Obj FuncIO_gmtime(Obj self, Obj time)
+ Obj tmp;
+ time_t t;
+ struct tm * s;
++ if (!IS_INT(time)) {
++ SyClearErrorNo();
++ return Fail;
++ }
+ if (!IS_INTOBJ(time)) {
+ tmp = QuoInt(time, INTOBJ_INT(256));
+ if (!IS_INTOBJ(tmp))
+@@ -1808,6 +1812,10 @@ static Obj FuncIO_localtime(Obj self, Obj time)
+ Obj tmp;
+ time_t t;
+ struct tm * s;
++ if (!IS_INT(time)) {
++ SyClearErrorNo();
++ return Fail;
++ }
+ if (!IS_INTOBJ(time)) {
+ tmp = QuoInt(time, INTOBJ_INT(256));
+ if (!IS_INTOBJ(tmp))
diff --git a/dev-gap/io/io-4.8.2.ebuild b/dev-gap/io/io-4.8.2-r1.ebuild
index 06e9f54c7b67..46c12ae997e9 100644
--- a/dev-gap/io/io-4.8.2.ebuild
+++ b/dev-gap/io/io-4.8.2-r1.ebuild
@@ -16,6 +16,9 @@ IUSE="examples"
DEPEND="sci-mathematics/gap:="
RDEPEND="${DEPEND}"
+# backport, merged upstream already
+PATCHES=( "${FILESDIR}/${P}-fix-failed-assertion.patch" )
+
gap-pkg_enable_tests
src_prepare() {