summaryrefslogtreecommitdiffstats
path: root/office/calcurse
diff options
context:
space:
mode:
author Dave Woodfall <dave@slackbuilds.org>2023-01-28 04:11:11 +0000
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2023-02-04 07:19:44 +0700
commit1e7e2617cab48bfaa9232e9f75806154e060d7ab (patch)
tree815cbde158fac89107c5634f378c7ccb4b468fdf /office/calcurse
parentc8014943c174beabdec05311a38565a74eb7f676 (diff)
downloadslackbuilds-1e7e2617cab48bfaa9232e9f75806154e060d7ab.tar.gz
slackbuilds-1e7e2617cab48bfaa9232e9f75806154e060d7ab.tar.xz
office/calcurse: Patch to avoid crash using -G.
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'office/calcurse')
-rw-r--r--office/calcurse/0001-Don-t-fclose-fp-if-it-failed-to-fopen.patch50
-rw-r--r--office/calcurse/calcurse.SlackBuild4
2 files changed, 53 insertions, 1 deletions
diff --git a/office/calcurse/0001-Don-t-fclose-fp-if-it-failed-to-fopen.patch b/office/calcurse/0001-Don-t-fclose-fp-if-it-failed-to-fopen.patch
new file mode 100644
index 0000000000..533dfaf24e
--- /dev/null
+++ b/office/calcurse/0001-Don-t-fclose-fp-if-it-failed-to-fopen.patch
@@ -0,0 +1,50 @@
+From dc63cf73781f9303ed1f12dc7e4ecfb6f3938f3c Mon Sep 17 00:00:00 2001
+From: dave <dave@slackbuilds.org>
+Date: Sat, 28 Jan 2023 01:51:55 +0000
+Subject: [PATCH] Don't fclose(fp) if it failed to fopen()
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------true"
+
+This is a multi-part message in MIME format.
+--------------true
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+This fixes a segfault in fclose@@GLIBC_2.2.5
+'calcurse -c /path/to/apts -G' segfaults at first note seen.
+Split the tests @ ical.c:216 into two:
+return if fopen(fp) failed.
+fclose(fp) and return @ EOF.
+
+Signed-off-by: dave <dave@slackbuilds.org>
+---
+ src/ical.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+
+--------------true
+Content-Type: text/x-patch; name="0001-Don-t-fclose-fp-if-it-failed-to-fopen.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-Don-t-fclose-fp-if-it-failed-to-fopen.patch"
+
+diff --git a/src/ical.c b/src/ical.c
+index 535bca8..4b55343 100644
+--- a/src/ical.c
++++ b/src/ical.c
+@@ -213,7 +213,10 @@ static void ical_export_note(FILE *stream, char *name)
+ int has_desc, has_prop, i;
+
+ asprintf(&note_file, "%s/%s", path_notes, name);
+- if (!(fp = fopen(note_file, "r")) || ungetc(getc(fp), fp) == EOF) {
++ if (!(fp = fopen(note_file, "r"))) {
++ return;
++ }
++ if (ungetc(getc(fp), fp) == EOF) {
+ fclose(fp);
+ return;
+ }
+
+--------------true--
+
+
diff --git a/office/calcurse/calcurse.SlackBuild b/office/calcurse/calcurse.SlackBuild
index 5201258667..2dbd716088 100644
--- a/office/calcurse/calcurse.SlackBuild
+++ b/office/calcurse/calcurse.SlackBuild
@@ -30,7 +30,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=calcurse
VERSION=${VERSION:-4.8.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -83,6 +83,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+patch -p1 <$CWD/0001-Don-t-fclose-fp-if-it-failed-to-fopen.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \