summaryrefslogtreecommitdiffstats
path: root/giflib
diff options
context:
space:
mode:
authorzorz <zorz@krypt.sh>2026-05-05 18:29:35 +0300
committerzorz <zorz@krypt.sh>2026-05-05 18:29:35 +0300
commit3ee93968e10126adc7dad5c8872f0170c3421e13 (patch)
treebcac8daa62b6c9a94a48dae87f5d3f6de1985bba /giflib
parent936433a5deb6ccc8f8476096f2c2b8dc72c33388 (diff)
downloadzorz-3ee93968e10126adc7dad5c8872f0170c3421e13.tar.gz
zorz-3ee93968e10126adc7dad5c8872f0170c3421e13.tar.xz
various obsolette
Diffstat (limited to 'giflib')
-rw-r--r--giflib/Pkgfile25
-rw-r--r--giflib/giflib-5.2.2-security_fixes-1.patch27
-rw-r--r--giflib/giflib-5.2.2-upstream_fixes-1.patch45
3 files changed, 97 insertions, 0 deletions
diff --git a/giflib/Pkgfile b/giflib/Pkgfile
new file mode 100644
index 0000000..781445a
--- /dev/null
+++ b/giflib/Pkgfile
@@ -0,0 +1,25 @@
1# Description: A compressed GIF library compatible with libungif
2# URL: https://giflib.sourceforge.net
3# Maintainer: zorz, zorz at gmx dot com
4
5name=giflib
6version=5.2.2
7release=2
8source=(https://sourceforge.net/projects/giflib/files/$name-$version.tar.gz
9 giflib-5.2.2-security_fixes-1.patch
10 giflib-5.2.2-upstream_fixes-1.patch)
11
12build() {
13 cd $name-$version
14
15 sed -e "/\$(MAKE) -C doc$/d" -i Makefile
16
17 patch -Np1 -i $SRC/giflib-5.2.2-security_fixes-1.patch
18 patch -Np1 -i $SRC/giflib-5.2.2-upstream_fixes-1.patch
19
20 make
21 make PREFIX=$PKG/usr install
22
23 install -vDm 644 doc/*.1 -t $PKG/usr/share/man/man1/
24 install -vDm 644 doc/*.7 -t $PKG/usr/share/man/man7/
25}
diff --git a/giflib/giflib-5.2.2-security_fixes-1.patch b/giflib/giflib-5.2.2-security_fixes-1.patch
new file mode 100644
index 0000000..b81d28a
--- /dev/null
+++ b/giflib/giflib-5.2.2-security_fixes-1.patch
@@ -0,0 +1,27 @@
1Submitted By: Douglas R. Reno <renodr at linuxfromscratch dot org>
2Date: 2025-05-19
3Initial Package Version: 5.2.2
4Upstream Status: Abandoned
5Origin: OpenMandriva (see BLFS Ticket #21574)
6Description: Fixes several CVEs in giflib that are known to lead to
7 a heap buffer overflow. The CVEs in question are
8 CVE-2025-31344, CVE-2024-45993, CVE-2023-48161, and
9 CVE-2022-28506. The CVEs are all rated High, and are
10 known to cause crashes with a lower chance of impacts
11 including arbitrary code execution.
12
13diff -Naurp giflib-5.2.2.orig/gif2rgb.c giflib-5.2.2/gif2rgb.c
14--- giflib-5.2.2.orig/gif2rgb.c 2024-02-18 21:01:28.000000000 -0600
15+++ giflib-5.2.2/gif2rgb.c 2025-05-19 15:23:36.911153908 -0500
16@@ -329,6 +329,11 @@ static void DumpScreen2RGB(char *FileNam
17 GifRow = ScreenBuffer[i];
18 GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
19 for (j = 0; j < ScreenWidth; j++) {
20+ /* Check if color is within color palete */
21+ if (GifRow[j] >= ColorMap->ColorCount) {
22+ GIF_EXIT(GifErrorString(
23+ D_GIF_ERR_IMAGE_DEFECT));
24+ }
25 ColorMapEntry = &ColorMap->Colors[GifRow[j]];
26 Buffers[0][j] = ColorMapEntry->Red;
27 Buffers[1][j] = ColorMapEntry->Green;
diff --git a/giflib/giflib-5.2.2-upstream_fixes-1.patch b/giflib/giflib-5.2.2-upstream_fixes-1.patch
new file mode 100644
index 0000000..798d8b6
--- /dev/null
+++ b/giflib/giflib-5.2.2-upstream_fixes-1.patch
@@ -0,0 +1,45 @@
1Submitted By: Douglas R. Reno <renodr at linuxfromscratch dot org>
2Date: 2024-03-02
3Initial Package Version: 5.2.2
4Origin: Upstream (thanks to Joe Locash for the pointer)
5Upstream Status: Applied
6Description: Prevents giflib from installing XML files into
7 /usr/share/man/man1 instead of manual pages.
8
9diff -Naurp giflib-5.2.2.orig/Makefile giflib-5.2.2/Makefile
10--- giflib-5.2.2.orig/Makefile 2024-03-02 12:53:46.244595714 -0600
11+++ giflib-5.2.2/Makefile 2024-03-02 12:55:35.428874223 -0600
12@@ -63,15 +63,19 @@ UTILS = $(INSTALLABLE) \
13
14 LDLIBS=libgif.a -lm
15
16-MANUAL_PAGES = \
17+MANUAL_PAGES_1 = \
18 doc/gif2rgb.xml \
19 doc/gifbuild.xml \
20 doc/gifclrmp.xml \
21 doc/giffix.xml \
22- doc/giflib.xml \
23 doc/giftext.xml \
24 doc/giftool.xml
25
26+MANUAL_PAGES_7 = \
27+ doc/giflib.xml
28+
29+MANUAL_PAGES = $(MANUAL_PAGES_1) $(MANUAL_PAGES_7)
30+
31 SOEXTENSION = so
32 LIBGIFSO = libgif.$(SOEXTENSION)
33 LIBGIFSOMAJOR = libgif.$(SOEXTENSION).$(LIBMAJOR)
34@@ -148,8 +152,9 @@ install-lib:
35 ln -sf $(LIBGIFSOVER) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSOMAJOR)"
36 ln -sf $(LIBGIFSOMAJOR) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSO)"
37 install-man:
38- $(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1"
39- $(INSTALL) -m 644 $(MANUAL_PAGES) "$(DESTDIR)$(MANDIR)/man1"
40+ $(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(MANDIR)/man7"
41+ $(INSTALL) -m 644 $(MANUAL_PAGES_1:xml=1) "$(DESTDIR)$(MANDIR)/man1"
42+ $(INSTALL) -m 644 $(MANUAL_PAGES_7:xml=7) "$(DESTDIR)$(MANDIR)/man7"
43 uninstall: uninstall-man uninstall-include uninstall-lib uninstall-bin
44 uninstall-bin:
45 cd "$(DESTDIR)$(BINDIR)" && rm -f $(INSTALLABLE)