1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

Fix a segfault when XftConfig or ~/.xftconfig contains directories with

gzip'd fonts.  The next release of freetype2 will allow building with
the system version of zlib, so this won't be an issue.

Reported by:	alane
Obtained from:	FreeType CVS and /usr/src/lib/libz/infcodes.c
Approved by:	maintainer
This commit is contained in:
Joe Marcus Clarke 2003-01-18 22:27:21 +00:00
parent c4897416bc
commit 3791ddb9ec
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=73437
3 changed files with 34 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= freetype2
PORTVERSION= 2.1.3
PORTREVISION= 1
CATEGORIES= print
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S,%SUBDIR%,freetype,} \
http://sunsite.cnlab-switch.ch/ftp/mirror/freetype/%SUBDIR%/ \

View File

@ -0,0 +1,20 @@
--- src/gzip/ftgzip.c.orig Sat Jan 18 13:04:29 2003
+++ src/gzip/ftgzip.c Sat Jan 18 13:04:40 2003
@@ -177,7 +177,7 @@
(void)FT_STREAM_SKIP( 6 );
/* skip the extra field */
- if ( head[3] && FT_GZIP_EXTRA_FIELD )
+ if ( head[3] & FT_GZIP_EXTRA_FIELD )
{
FT_UInt len;
@@ -187,7 +187,7 @@
}
/* skip original file name */
- if ( head[3] && FT_GZIP_ORIG_NAME )
+ if ( head[3] & FT_GZIP_ORIG_NAME )
for (;;)
{
FT_UInt c;

View File

@ -0,0 +1,13 @@
--- src/gzip/infcodes.c.orig Sat Jan 18 15:44:46 2003
+++ src/gzip/infcodes.c Sat Jan 18 15:46:10 2003
@@ -196,8 +196,8 @@
c->mode = COPY;
case COPY: /* o: copying bytes in window, waiting for space */
f = q - c->sub.copy.dist;
- while (f < s->window) /* modulo window size-"while" instead */
- f += s->end - s->window; /* of "if" handles invalid distances */
+ if ((uInt)(q - s->window) < c->sub.copy.dist)
+ f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
while (c->len)
{
NEEDOUT