update to gif2png-2.5.9, from Jason Tubnor

minor tweaks while there (groff not needed, use separate build,
use standard wantlib format)
This commit is contained in:
sthen 2014-10-30 10:15:59 +00:00
parent 0311a384b9
commit a5ffe3cf8b
3 changed files with 11 additions and 70 deletions

View File

@ -1,23 +1,23 @@
# $OpenBSD: Makefile,v 1.42 2013/06/03 02:46:57 naddy Exp $
# $OpenBSD: Makefile,v 1.43 2014/10/30 10:15:59 sthen Exp $
COMMENT= converts GIF images to the PNG format
DISTNAME= gif2png-2.5.2
REVISION= 1
DISTNAME= gif2png-2.5.9
CATEGORIES= graphics
HOMEPAGE= http://www.catb.org/~esr/gif2png/
# BSD
PERMIT_PACKAGE_CDROM= Yes
WANTLIB= c m z png
WANTLIB += c m png z
MASTER_SITES= ${HOMEPAGE}
LIB_DEPENDS= graphics/png
USE_GMAKE= Yes
USE_GROFF = Yes
CONFIGURE_STYLE= gnu
SEPARATE_BUILD= Yes
CONFIGURE_ARGS= --with-png-inc="${LOCALBASE}/include" \
--with-png-lib="${LOCALBASE}/lib"

View File

@ -1,5 +1,2 @@
MD5 (gif2png-2.5.2.tar.gz) = IgCEHwJ8hIHEuFGdq/dFsA==
RMD160 (gif2png-2.5.2.tar.gz) = o2GxivI+WbcxIa4loVW1T7YusUo=
SHA1 (gif2png-2.5.2.tar.gz) = Dp5m1nKP5+Lc3mGtDjmKYIlJRrM=
SHA256 (gif2png-2.5.2.tar.gz) = wbQGatN83LhoHOzt1j2u2MtcgnNE2kZScPMkvBL/Ptc=
SIZE (gif2png-2.5.2.tar.gz) = 171740
SHA256 (gif2png-2.5.9.tar.gz) = yEBrfAwI9QSVKhcZ4E8jZu5EyIjA7frDpj/qKrBbZMc=
SIZE (gif2png-2.5.9.tar.gz) = 137750

View File

@ -1,36 +1,6 @@
$OpenBSD: patch-gif2png_c,v 1.2 2011/07/08 20:36:09 naddy Exp $
Fixes cmdline buffer overflow described in
http://lists.grok.org.uk/pipermail/full-disclosure/2009-December/072002.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550978
From: http://cvs.fedoraproject.org/viewvc/rpms/gif2png/devel/gif2png-overflow.patch?revision=HEAD&root=extras&view=markup
Fix build with png-1.5.
--- gif2png.c.orig Wed Nov 11 13:28:02 2009
+++ gif2png.c Wed Jul 6 17:39:37 2011
@@ -10,6 +10,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h> /* for isatty() */
+#include <zlib.h>
#if !defined(TRUE)
#define FALSE 0
@@ -120,8 +121,8 @@ int writefile(struct GIFelement *s,struct GIFelement *
int colors_used = 0;
byte remap[MAXCMSIZE];
int low_prec;
- png_struct *png_ptr = xalloc(sizeof (png_struct));
- png_info *info_ptr = xalloc(sizeof (png_info));
+ png_struct *png_ptr;
+ png_info *info_ptr;
int p;
int gray_bitdepth;
png_color pal_rgb[MAXCMSIZE], *pltep;
@@ -136,6 +137,19 @@ int writefile(struct GIFelement *s,struct GIFelement *
--- gif2png.c.orig Wed Oct 29 11:16:37 2014
+++ gif2png.c Wed Oct 29 11:35:23 2014
@@ -140,6 +140,19 @@ static int writefile(struct GIFelement *s, struct GIFe
png_text software;
png_text comment;
@ -49,30 +19,4 @@ Fix build with png-1.5.
+
/* these volatile declarations prevent gcc warnings ("variable might be
* clobbered by `longjmp' or `vfork'") */
volatile int gray = TRUE;
@@ -682,7 +696,10 @@ int processfile(char *fname, FILE *fp)
strcpy(outname, fname);
- file_ext = outname+strlen(outname)-4;
+ file_ext = outname+strlen(outname);
+ if (file_ext >= outname + 4)
+ file_ext -= 4;
+
if (strcmp(file_ext, ".gif") != 0 && strcmp(file_ext, ".GIF") != 0 &&
strcmp(file_ext, "_gif") != 0 && strcmp(file_ext, "_GIF") != 0) {
/* try to derive basename */
@@ -874,6 +891,13 @@ int main(int argc, char *argv[])
}
} else {
for (i = ac;i<argc; i++) {
+ /* make sure that there is enough space for a '.p<NUM>' suffix;
+ this check catches also the '.gif' case below. */
+ if (strlen(argv[i]) >= sizeof name - sizeof ".p" - 3 * sizeof(int)) {
+ fprintf(stderr, "%s: name too long\n", argv[i]);
+ errors = 1;
+ continue;
+ }
strcpy(name, argv[i]);
if ((fp = fopen(name, "rb")) == NULL) {
/* retry with .gif appended */
volatile bool gray = true;