Skip to content

Commit 4807dbc

Browse files
committed
giflib*: update to 6.1.2
Version 6.1.2 ============= Code Fixes ---------- * Fix for low-severity CVE-2026-23868 affecting gifponge, giftool, and gifbuild, but not the core library - library clients need not be alarned. Version 6.1.1 ============= This release bumps the major version, but only one entry point - EGifSpew() - has changed signature and behavior (in order to be able to pass out a detailed error code). The internal error codes in the E_GIF_ERR series have changed value so none of them collides with GIF_ERROR. This code has been systematically audited and hardened wuth ChatGPT-5.2. The only library fixes reported by users or found by robot were for some memory leaks that could only triggered by severely malformed GIFs. Other bugs are edge-case failures in the CLI tools. The gif2rbg CLI tool has been moved to the "obsolete" bin, because its only deployment case in 2026 is as a piñata at fuzzer parties. Warning: the CLI tools in the obsolete category will soon be removed from the distribution entirely. The maintainer is tired of fielding junk bugs filed against them by would-be coup-counters who found yet another edge case, and the rest of the world doesn't need noisy CVEs that aren't actually DoS or security issues for giflib clients. Code Fixes ---------- * Fix for CVE-2021-40633. * Fix SF bug #165 EGifSpew leaks GifFileOut->SColorMap * Fix SF bug #171 ImageMagick required to build giflib on non-Darwin Platforms * Fix SF bug #172 Incorrect object files in shared libutil on darwin * Fix SF bug #173 installation of manual pages and html documentation * Fix SF bug #175 Memory leaks in gifecho.c's main() and in gifalloc.c's GifMakeMapObject * Fix SF bug #177 wrong pointer used in giftool getbool * Fix SF bug #179 Path Traversal vulnerability * Fix SF bug #180: -Wformat-truncation likely pointing out an actual bug * Fix SF bug #182 out‐of‐bounds writes in Icon2Gif * Fix SF bug #184 uninitialized buffer in DumpScreen2RGB * Fix SF bug #185 integer overflow in gifbg.c * Fix SF bug #186 integer overflow in Icon2Gif * Fix SF bug #187: CVE-2025-31344 * Fix SF bug #170 Tests failing on Ubuntu Noble, giftext buffer overflow * Fix SF bug #165 EGifSpew leaks GifFileOut->SColorMap * Fix SF bug #162 detected memory leaks in GifMakeSavedImage giflib/gifalloc.c * Fix SF bug #161 detected memory leaks in EGifOpenFileHandle giflib/egif_lib.c * Fix SF bug #142 ABI break public symbol GifQuantizeBuffer Other bugs that duplicate these have breen addressesed by these fixes * SF bug #156 EGifSpew leaks SavedImages (and more); won't fix, caller might want to write a GIF, modify the in-memory data, then write again. Tests ----- Test suite now emits TAP (Test Anything Protocol).
1 parent 9382afc commit 4807dbc

File tree

7 files changed

+57
-86
lines changed

7 files changed

+57
-86
lines changed

graphics/giflib-util/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# $NetBSD: Makefile,v 1.16 2025/05/04 11:19:20 nia Exp $
1+
# $NetBSD: Makefile,v 1.17 2026/03/10 20:40:57 wiz Exp $
22

33
.include "../../graphics/giflib/Makefile.common"
44

55
PKGNAME= ${DISTNAME:S/-/-util-/}
6-
PKGREVISION= 1
76

87
COMMENT= GIF image format utility
98

graphics/giflib-util/PLIST

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
@comment $NetBSD: PLIST,v 1.6 2024/09/18 23:02:59 nia Exp $
2-
bin/gif2rgb
1+
@comment $NetBSD: PLIST,v 1.7 2026/03/10 20:40:57 wiz Exp $
32
bin/gifbuild
43
bin/gifclrmp
54
bin/giffix

graphics/giflib/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# $NetBSD: Makefile,v 1.60 2025/05/04 11:19:19 nia Exp $
1+
# $NetBSD: Makefile,v 1.61 2026/03/10 20:40:57 wiz Exp $
22

33
.include "Makefile.common"
44

5-
PKGREVISION= 1
6-
75
COMMENT= GIF image format library
86

97
CONFLICTS+= libungif-[0-9]*
108

119
# clang: error: no such file or directory: 'dgif_lib.o'
1210
# clang: error: no such file or directory: 'egif_lib.o'
13-
MAKE_JOBS_SAFE= no
11+
#MAKE_JOBS_SAFE= no
1412

1513
INSTALL_TARGET= install-include
1614
INSTALL_TARGET+= install-lib
1715

16+
TEST_TARGET= check
17+
1818
.include "../../mk/bsd.pkg.mk"

graphics/giflib/Makefile.common

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# $NetBSD: Makefile.common,v 1.16 2025/11/17 11:00:55 wiz Exp $
1+
# $NetBSD: Makefile.common,v 1.17 2026/03/10 20:40:57 wiz Exp $
22
# used by graphics/giflib/Makefile
33
# used by graphics/giflib-util/Makefile
44

5-
DISTNAME= giflib-5.2.2
5+
DISTNAME= giflib-6.1.2
66
CATEGORIES= graphics
77
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=giflib/}
88

@@ -16,3 +16,5 @@ DISTINFO_FILE= ${.CURDIR}/../../graphics/giflib/distinfo
1616
USE_LANGUAGES= c c++
1717
USE_LIBTOOL= yes
1818
USE_TOOLS+= gmake
19+
20+
CFLAGS.NetBSD+= -DHAVE_REALLOCARRAY

graphics/giflib/distinfo

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
$NetBSD: distinfo,v 1.31 2025/05/04 11:19:19 nia Exp $
1+
$NetBSD: distinfo,v 1.32 2026/03/10 20:40:57 wiz Exp $
22

3-
BLAKE2s (giflib-5.2.2.tar.gz) = 2a24163a1af876f9241b5971a7e523f054d131661435e4a3ab11b7cf6acc20f1
4-
SHA512 (giflib-5.2.2.tar.gz) = 0865ab2b1904fa14640c655fdb14bb54244ad18a66e358565c00287875d00912343f9be8bfac7658cc0146200d626f7ec9160d7a339f20ba3be6b9941d73975f
5-
Size (giflib-5.2.2.tar.gz) = 447175 bytes
6-
SHA1 (patch-CVE-2025-31344) = ea977fd36f1e7bb03844dd8eae9a6e70ceb5d4d6
7-
SHA1 (patch-Makefile) = f7dcce252760dfdcafee46513936d6a2a6fcd668
3+
BLAKE2s (giflib-6.1.2.tar.gz) = 4a11ffb04a0e4b68025385a55e5d96141349612c91444b66152f8b9fba045004
4+
SHA512 (giflib-6.1.2.tar.gz) = 523cf2a9941c6ddb903bf5ec22ecbf5a283c9470c1c85229360ab4137227a9e4a64b799e3ff0ca1f9f3b9de0fafe197a43fccd3c043239e76561f7b5ede59193
5+
Size (giflib-6.1.2.tar.gz) = 469032 bytes
6+
SHA1 (patch-Makefile) = 6f702c821b4da37ce126a6c896ac1b75884f09b6

graphics/giflib/patches/patch-CVE-2025-31344

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,38 @@
1-
$NetBSD: patch-Makefile,v 1.9 2024/09/19 09:01:15 nia Exp $
1+
$NetBSD: patch-Makefile,v 1.10 2026/03/10 20:40:57 wiz Exp $
22

33
- Libtoolize.
44
- Allow override of PREFIX.
55
- Allow separate installation of utilities.
66
- Move quantize.c back into libgif.so to fix various library users.
77

8-
--- Makefile.orig 2024-02-19 01:01:50.000000000 +0000
8+
--- Makefile.orig 2026-03-10 17:50:52.000000000 +0000
99
+++ Makefile
10-
@@ -8,13 +8,13 @@
11-
#
12-
OFLAGS = -O0 -g
13-
OFLAGS = -O2
14-
-CFLAGS = -std=gnu99 -fPIC -Wall -Wno-format-truncation $(OFLAGS)
15-
+CFLAGS += -std=gnu99 -fPIC
16-
17-
SHELL = /bin/sh
18-
TAR = tar
19-
INSTALL = install
20-
21-
-PREFIX = /usr/local
22-
+PREFIX?= /usr/local
23-
BINDIR = $(PREFIX)/bin
24-
INCDIR = $(PREFIX)/include
25-
LIBDIR = $(PREFIX)/lib
26-
@@ -29,13 +29,13 @@ LIBPOINT=0
27-
LIBVER=$(LIBMAJOR).$(LIBMINOR).$(LIBPOINT)
28-
10+
@@ -36,11 +36,11 @@ HEADERS = gif_hash.h gif_lib.h gif_lib_private.h
2911
SOURCES = dgif_lib.c egif_lib.c gifalloc.c gif_err.c gif_font.c \
30-
- gif_hash.c openbsd-reallocarray.c
31-
+ gif_hash.c openbsd-reallocarray.c quantize.c
12+
gif_hash.c openbsd-reallocarray.c quantize.c
3213
HEADERS = gif_hash.h gif_lib.h gif_lib_private.h
3314
-OBJECTS = $(SOURCES:.c=.o)
3415
+OBJECTS = $(SOURCES:.c=.lo)
3516

36-
-USOURCES = qprintf.c quantize.c getarg.c
37-
+USOURCES = qprintf.c getarg.c
17+
USOURCES = qprintf.c getarg.c
3818
UHEADERS = getarg.h
3919
-UOBJECTS = $(USOURCES:.c=.o)
4020
+UOBJECTS = $(USOURCES:.c=.lo)
4121

4222
UNAME:=$(shell uname)
4323

44-
@@ -61,7 +61,7 @@ UTILS = $(INSTALLABLE) \
45-
gifsponge \
46-
gifwedge
24+
@@ -75,7 +75,7 @@ UTILS = $(INSTALLABLE) \
25+
gifwedge \
26+
gif2rgb
4727

4828
-LDLIBS=libgif.a -lm
4929
+LDLIBS=-lm
5030

51-
MANUAL_PAGES = \
52-
doc/gif2rgb.xml \
53-
@@ -72,45 +72,30 @@ MANUAL_PAGES = \
54-
doc/giftext.xml \
55-
doc/giftool.xml
31+
MANUAL_PAGES_1 = \
32+
doc/gifbuild.xml \
33+
@@ -91,52 +91,37 @@ MANUAL_PAGES_7_MAN = $(MANUAL_PAGES_7:%.xml=%.7)
34+
MANUAL_PAGES_1_MAN = $(MANUAL_PAGES_1:%.xml=%.1)
35+
MANUAL_PAGES_7_MAN = $(MANUAL_PAGES_7:%.xml=%.7)
5636

5737
-SOEXTENSION = so
5838
+SOEXTENSION = la
@@ -70,66 +50,79 @@ $NetBSD: patch-Makefile,v 1.9 2024/09/19 09:01:15 nia Exp $
7050
-LIBUTILSOMAJOR = libutil.$(LIBMAJOR).$(SOEXTENSION)
7151
-endif
7252

73-
-all: $(LIBGIFSO) libgif.a $(LIBUTILSO) libutil.a $(UTILS)
53+
SHARED_LIBS = $(LIBGIFSO) $(LIBUTILSO)
54+
STATIC_LIBS = libgif.a libutil.a
55+
56+
-all: shared-lib static-lib $(UTILS)
7457
-ifeq ($(UNAME), Darwin)
7558
-else
7659
- $(MAKE) -C doc
7760
-endif
7861
+all: $(LIBGIFSO) $(LIBUTILSO)
7962

80-
-$(UTILS):: libgif.a libutil.a
63+
-$(UTILS):: $(STATIC_LIBS)
8164
+.SUFFIXES: .lo
8265

66+
shared-lib: $(SHARED_LIBS)
67+
68+
static-lib: $(STATIC_LIBS)
69+
8370
-$(LIBGIFSO): $(OBJECTS) $(HEADERS)
8471
-ifeq ($(UNAME), Darwin)
8572
- $(CC) $(CFLAGS) -dynamiclib -current_version $(LIBVER) $(OBJECTS) -o $(LIBGIFSO)
8673
-else
87-
- $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBGIFSOMAJOR) -o $(LIBGIFSO) $(OBJECTS)
74+
- $(CC) $(CFLAGS) $(CPPFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBGIFSOMAJOR) -o $(LIBGIFSO) $(OBJECTS)
8875
-endif
8976
+.c.lo:
9077
+ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) -c $<
91-
+
92-
+.libs/libgif.a: $(LIBGIFSO)
93-
+.libs/libutil.a: $(LIBUTILSO)
9478

9579
-libgif.a: $(OBJECTS) $(HEADERS)
9680
- $(AR) rcs libgif.a $(OBJECTS)
81+
+.libs/libgif.a: $(LIBGIFSO)
82+
+.libs/libutil.a: $(LIBUTILSO)
83+
9784
+$(UTILS): .libs/libutil.a .libs/libgif.a
9885
+
9986
+$(LIBGIFSO): $(OBJECTS) $(HEADERS)
10087
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) -version-info $(LIBMAJOR):0:0 -rpath $(PREFIX)/lib -o $(LIBGIFSO) $(OBJECTS)
101-
88+
+
10289
$(LIBUTILSO): $(UOBJECTS) $(UHEADERS)
10390
-ifeq ($(UNAME), Darwin)
104-
- $(CC) $(CFLAGS) -dynamiclib -current_version $(LIBVER) $(OBJECTS) -o $(LIBUTILSO)
91+
- $(CC) $(CFLAGS) -dynamiclib -current_version $(LIBVER) $(UOBJECTS) -o $(LIBUTILSO)
10592
-else
106-
- $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBUTILMAJOR) -o $(LIBUTILSO) $(UOBJECTS)
93+
- $(CC) $(CFLAGS) $(CPPLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBUTILSOMAJOR) -o $(LIBUTILSO) $(UOBJECTS)
10794
-endif
10895
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) -version-info $(LIBMAJOR):0:0 -rpath $(PREFIX)/lib -o $(LIBUTILSO) $(UOBJECTS)
10996

11097
libutil.a: $(UOBJECTS) $(UHEADERS)
11198
$(AR) rcs libutil.a $(UOBJECTS)
112-
@@ -129,11 +114,7 @@ reflow:
99+
@@ -166,11 +151,7 @@ spellcheck:
113100

114-
# Installation/uninstallation
101+
# Install/uninstall
115102

116103
-ifeq ($(UNAME), Darwin)
117104
-install: all install-bin install-include install-lib
118105
-else
119-
install: all install-bin install-include install-lib install-man
106+
install: all install-bin install-include install-lib install-man install-doc
120107
-endif
121108

122109
install-bin: $(INSTALLABLE)
123110
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
124-
@@ -143,10 +124,7 @@ install-include:
111+
@@ -178,15 +159,9 @@ install-include:
112+
install-include:
113+
$(INSTALL) -d "$(DESTDIR)$(INCDIR)"
125114
$(INSTALL) -m 644 gif_lib.h "$(DESTDIR)$(INCDIR)"
126-
install-lib:
115+
-install-static-lib:
116+
+install-lib:
127117
$(INSTALL) -d "$(DESTDIR)$(LIBDIR)"
128118
- $(INSTALL) -m 644 libgif.a "$(DESTDIR)$(LIBDIR)/libgif.a"
119+
-install-shared-lib:
120+
- $(INSTALL) -d "$(DESTDIR)$(LIBDIR)"
129121
- $(INSTALL) -m 755 $(LIBGIFSO) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSOVER)"
130122
- ln -sf $(LIBGIFSOVER) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSOMAJOR)"
131123
- ln -sf $(LIBGIFSOMAJOR) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSO)"
124+
-install-lib: install-static-lib install-shared-lib
132125
+ $(LIBTOOL) --mode=install --tag=CC $(BSD_INSTALL_LIB) $(LIBGIFSO) "$(DESTDIR)$(LIBDIR)"
133126
install-man:
134-
$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1"
135-
$(INSTALL) -m 644 $(MANUAL_PAGES) "$(DESTDIR)$(MANDIR)/man1"
127+
$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(MANDIR)/man7"
128+
$(INSTALL) -m 644 $(MANUAL_PAGES_1_MAN) "$(DESTDIR)$(MANDIR)/man1"

0 commit comments

Comments
 (0)