Index: head/x11-servers/XFree86-4-Server/Makefile =================================================================== --- head/x11-servers/XFree86-4-Server/Makefile (revision 100787) +++ head/x11-servers/XFree86-4-Server/Makefile (revision 100788) @@ -1,190 +1,190 @@ # New ports collection makefile for: XFree86-Server # Date created: 10 Oct 1999 # Whom: taguchi@tohoku.iij.ad.jp # # $FreeBSD$ # PORTNAME= Server PORTVERSION= 4.3.0 -PORTREVISION= 13 +PORTREVISION= 14 CATEGORIES= x11-servers MASTER_SITES= ${MASTER_SITE_XFREE:S/$/:x/} \ ${MASTER_SITE_LOCAL:S/$/:local/} MASTER_SITE_SUBDIR= ${PORTVERSION}/:x \ anholt/:local PKGNAMEPREFIX= XFree86- DISTFILES= X430src-1.tgz:x \ X430src-2.tgz:x \ X430src-3.tgz:x \ Wraphelp2.gz:local EXTRACT_ONLY= X430src-1.tgz \ X430src-2.tgz \ X430src-3.tgz MAINTAINER= x11@FreeBSD.org COMMENT= XFree86-4 X server and related programs EXTRA_PATCHES+= \ ${FILESDIR}/patch-FreeBSD.cf \ ${FILESDIR}/patch-Pci.h \ ${FILESDIR}/patch-Sbus.c \ ${FILESDIR}/patch-alpha_video.c \ ${FILESDIR}/patch-bsd-Imakefile \ ${FILESDIR}/patch-bsd-bsdResource.c \ ${FILESDIR}/patch-bsd_Imakefile \ ${FILESDIR}/patch-bus-Imakefile \ ${FILESDIR}/patch-bus_Imakefile \ ${FILESDIR}/patch-compiler.h \ - ${FILESDIR}/patch-dirfile.c \ ${FILESDIR}/patch-elfloader.c \ ${FILESDIR}/patch-freebsdPci.c \ ${FILESDIR}/patch-ftfuncs.c \ ${FILESDIR}/patch-int10-generic.c \ ${FILESDIR}/patch-libc_wrapper.c \ ${FILESDIR}/patch-loader-Imakefile \ ${FILESDIR}/patch-loader-elfloader.c \ ${FILESDIR}/patch-loader.c \ ${FILESDIR}/patch-mga_dri.c \ ${FILESDIR}/patch-mga_driver.c \ ${FILESDIR}/patch-nv_driver.c \ ${FILESDIR}/patch-nv_setup.c \ ${FILESDIR}/patch-os-support_Imakefile \ ${FILESDIR}/patch-r128_driver.c \ ${FILESDIR}/patch-radeon_cursor.c \ ${FILESDIR}/patch-radeon_dri.c \ ${FILESDIR}/patch-radeon_reg.h \ ${FILESDIR}/patch-savage-pci-id \ ${FILESDIR}/patch-smi \ ${FILESDIR}/patch-sunffb_Imakefile \ + ${FILESDIR}/patch-xc::lib::font::fontfile \ ${FILESDIR}/patch-xf86-common-Imakefile \ ${FILESDIR}/patch-xf86Events.c \ ${FILESDIR}/patch-xf86Sbus.h \ ${FILESDIR}/patch-xf86sym.c \ ${FILESDIR}/patch-xkbInit.c SCRIPTS_ENV= OSVERSION=${OSVERSION} \ BuildXF86DRI=${BuildXF86DRI} \ WITH_DEBUG="${WITH_DEBUG}" MAN1= XFree86.1 \ Xserver.1 \ gtf.1 \ kbd_mode.1 \ pcitweak.1 \ xf86cfg.1 \ xf86config.1 MAN3= XF86VidMode.3 \ XF86VidModeDeleteModeLine.3 \ XF86VidModeGetAllModeLines.3 \ XF86VidModeGetDotClocks.3 \ XF86VidModeGetGamma.3 \ XF86VidModeGetGammaRamp.3 \ XF86VidModeGetGammaRampSize.3 \ XF86VidModeGetModeLine.3 \ XF86VidModeGetMonitor.3 \ XF86VidModeGetPermissions.3 \ XF86VidModeGetViewPort.3 \ XF86VidModeLockModeSwitch.3 \ XF86VidModeModModeLine.3 \ XF86VidModeQueryExtension.3 \ XF86VidModeQueryVersion.3 \ XF86VidModeSetClientVersion.3 \ XF86VidModeSetGamma.3 \ XF86VidModeSetGammaRamp.3 \ XF86VidModeSetViewPort.3 \ XF86VidModeSwitchMode.3 \ XF86VidModeSwitchToMode.3 \ XF86VidModeValidateModeLine.3 MAN4= citron.4 \ dynapro.4 \ elographics.4 \ fbdevhw.4 \ kbd.4 \ keyboard.4 \ microtouch.4 \ mouse.4 \ mutouch.4 \ nv.4 \ r128.4 \ radeon.4 \ void.4 \ wacom.4 MAN5= XF86Config.5 PKGMESSAGE= ${WRKDIR}/.pkg-message XBUILD_DIRS= lib/font lib/lbxutil lib/Xdmcp lib/Xau programs/Xserver XINCLUDE_DIRS= lib/xkbfile lib/xtrans XINSTALL_DIRS= lib/font programs/Xserver XINSTALL_MAN_DIRS= programs/Xserver NOT_FOR_ARCHS= ia64 .include "${.CURDIR}/../../x11/XFree86-4-libraries/Makefile.inc" .include .if ${ARCH} == i386 || ${ARCH} == alpha RUN_DEPENDS+= ${X11BASE}/lib/modules/dri/r200_dri.so:${PORTSDIR}/graphics/dri BuildXF86DRI= YES PLIST_SUB+= DRI="" .else BuildXF86DRI= NO PLIST_SUB+= DRI="@comment " .endif .if ${ARCH} == ia64 PLIST_SUB+= IA64_NA="@comment " .else PLIST_SUB+= IA64_NA="" .endif .if ${ARCH} == sparc64 PLIST_SUB+= SPARC64="" PLIST_SUB+= SPARC64_NA="@comment " MAN4+= sunffb.4 .else PLIST_SUB+= SPARC64="@comment " PLIST_SUB+= SPARC64_NA="" MAN4+= glint.4 \ mga.4 \ rendition.4 \ s3virge.4 \ savage.4 \ siliconmotion.4 \ tdfx.4 \ vga.4 .endif .if ${ARCH} == i386 PLIST_SUB+= I386="" MAN1+= scanpci.1 MAN4+= apm.4 \ chips.4 \ cirrus.4 \ cyrix.4 \ i128.4 \ i740.4 \ i810.4 \ neomagic.4 \ nsc.4 \ sis.4 \ trident.4 \ tseng.4 \ vesa.4 \ vmware.4 .else PLIST_SUB+= I386="@comment " .endif post-extract:: ${GUNZIP_CMD} -c ${DISTDIR}/${DIST_SUBDIR}/Wraphelp2.gz > \ ${WRKSRC}/lib/Xdmcp/Wraphelp.c post-build: @${RM} -f ${PKGMESSAGE} @${CAT} ${.CURDIR}/pkg-message >> ${PKGMESSAGE} post-install:: @${SED} -e s,/usr/X11R6,${PREFIX}, ${PKGMESSAGE} @if [ -f ${PREFIX}/bin/Xwrapper-4 ] ; then \ ${LN} -sf Xwrapper-4 ${PREFIX}/bin/X; \ fi; .include Property changes on: head/x11-servers/XFree86-4-Server/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.153 \ No newline at end of property +1.154 \ No newline at end of property Index: head/x11-servers/XFree86-4-Server/files/patch-dirfile.c =================================================================== --- head/x11-servers/XFree86-4-Server/files/patch-dirfile.c (revision 100787) +++ head/x11-servers/XFree86-4-Server/files/patch-dirfile.c (nonexistent) @@ -1,13 +0,0 @@ ---- lib/font/fontfile/dirfile.c.orig Fri May 31 20:45:50 2002 -+++ lib/font/fontfile/dirfile.c Thu Feb 5 00:19:57 2004 -@@ -286,6 +286,10 @@ - status = AllocError; - break; - case NAME: -+ if (strlen(lexToken) >= sizeof(alias)) { -+ status = BadFontPath; -+ break; -+ } - strcpy(alias, lexToken); - token = lexAlias(file, &lexToken); - switch (token) { Property changes on: head/x11-servers/XFree86-4-Server/files/patch-dirfile.c ___________________________________________________________________ Deleted: cvs2svn:cvs-rev ## -1 +0,0 ## -1.1 \ No newline at end of property Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/x11-servers/XFree86-4-Server/files/patch-xc::lib::font::fontfile =================================================================== --- head/x11-servers/XFree86-4-Server/files/patch-xc::lib::font::fontfile (nonexistent) +++ head/x11-servers/XFree86-4-Server/files/patch-xc::lib::font::fontfile (revision 100788) @@ -0,0 +1,185 @@ +Index: lib/font/fontfile/dirfile.c +=================================================================== +RCS file: /home/x-cvs/xc/lib/font/fontfile/dirfile.c,v +retrieving revision 3.15 +diff -u -r3.15 dirfile.c +--- dirfile.c 31 May 2002 18:45:50 -0000 3.15 ++++ dirfile.c 11 Feb 2004 21:17:20 -0000 +@@ -68,6 +68,9 @@ + + FontDirectoryPtr dir = NullFontDirectory; + ++ if (strlen(directory) + 1 + sizeof(FontDirFile) > sizeof(dir_file)) ++ return BadFontPath; ++ + #ifdef FONTDIRATTRIB + /* Check for font directory attributes */ + #ifndef __UNIXOS2__ +@@ -154,6 +157,9 @@ + char dir_file[MAXFONTFILENAMELEN]; + struct stat statb; + ++ if (strlen(dir->directory) + sizeof(FontDirFile) > sizeof(dir_file)) ++ return FALSE; ++ + strcpy (dir_file, dir->directory); + strcat (dir_file, FontDirFile); + if (stat (dir_file, &statb) == -1) +@@ -202,6 +208,8 @@ + continue; + + len = strlen (fileName) - renderer->fileSuffixLen; ++ if (len >= sizeof(copy)) ++ continue; + CopyISOLatin1Lowered (copy, fileName, len); + copy[len] = '\0'; + name.name = copy; +@@ -251,9 +259,13 @@ + int status = Successful; + struct stat statb; + ++ if (strlen(directory) >= sizeof(alias_file)) ++ return BadFontPath; + dir = *pdir; + strcpy(alias_file, directory); + if (!isFile) { ++ if (strlen(directory) + 1 + sizeof(FontAliasFile) > sizeof(alias_file)) ++ return BadFontPath; + if (directory[strlen(directory) - 1] != '/') + strcat(alias_file, "/"); + strcat(alias_file, FontAliasFile); +@@ -286,6 +298,10 @@ + status = AllocError; + break; + case NAME: ++ if (strlen(lexToken) >= sizeof(alias)) { ++ status = BadFontPath; ++ break; ++ } + strcpy(alias, lexToken); + token = lexAlias(file, &lexToken); + switch (token) { +@@ -302,6 +318,10 @@ + status = AllocError; + break; + case NAME: ++ if (strlen(lexToken) >= sizeof(font_name)) { ++ status = BadFontPath; ++ break; ++ } + CopyISOLatin1Lowered(alias, alias, strlen(alias)); + CopyISOLatin1Lowered(font_name, lexToken, strlen(lexToken)); + if (!FontFileAddFontAlias (dir, alias, font_name)) +Index: lib/font/fontfile/encparse.c +=================================================================== +RCS file: /home/x-cvs/xc/lib/font/fontfile/encparse.c,v +retrieving revision 1.18 +diff -u -r1.18 encparse.c +--- encparse.c 2 Nov 2001 03:06:40 -0000 1.18 ++++ encparse.c 11 Feb 2004 21:17:20 -0000 +@@ -833,6 +833,7 @@ + char file_name[MAXFONTFILENAMELEN], encoding_name[MAXFONTNAMELEN], + buf[MAXFONTFILENAMELEN]; + int count, n; ++ static char format[24] = ""; + + /* As we don't really expect to open encodings that often, we don't + take the trouble of caching encodings directories. */ +@@ -848,8 +849,12 @@ + } + + encoding = NULL; ++ if (!format[0]) { ++ sprintf(format, "%%%ds %%%d[^\n]\n", sizeof(encoding_name) - 1, ++ sizeof(file_name) - 1); ++ } + for(;;) { +- count = fscanf(file, "%s %[^\n]\n", encoding_name, file_name); ++ count = fscanf(file, format, encoding_name, file_name); + if(count == EOF) + break; + if(count != 2) +Index: lib/font/fontfile/fontfile.c +=================================================================== +RCS file: /home/x-cvs/xc/lib/font/fontfile/fontfile.c,v +retrieving revision 3.16 +diff -u -r3.16 fontfile.c +--- fontfile.c 31 May 2002 18:45:50 -0000 3.16 ++++ fontfile.c 11 Feb 2004 21:17:20 -0000 +@@ -424,11 +424,16 @@ + vals.ranges = ranges; + vals.nranges = nranges; + +- strcpy (fileName, dir->directory); +- strcat (fileName, scalable->fileName); +- ret = (*scalable->renderer->OpenScalable) (fpe, pFont, ++ if (strlen(dir->directory) + strlen(scalable->fileName) >= ++ sizeof(fileName)) { ++ ret = BadFontName; ++ } else { ++ strcpy (fileName, dir->directory); ++ strcat (fileName, scalable->fileName); ++ ret = (*scalable->renderer->OpenScalable) (fpe, pFont, + flags, entry, fileName, &vals, format, fmask, + non_cachable_font); ++ } + + /* In case rasterizer does something bad because of + charset subsetting... */ +@@ -497,6 +502,8 @@ + + dir = (FontDirectoryPtr) fpe->private; + bitmap = &entry->u.bitmap; ++ if (strlen(dir->directory) + strlen(bitmap->fileName) >= sizeof(fileName)) ++ return BadFontName; + strcpy (fileName, dir->directory); + strcat (fileName, bitmap->fileName); + ret = (*bitmap->renderer->OpenBitmap) +@@ -530,6 +537,8 @@ + + dir = (FontDirectoryPtr) fpe->private; + bitmap = &entry->u.bitmap; ++ if (strlen(dir->directory) + strlen(bitmap->fileName) >= sizeof(fileName)) ++ return BadFontName; + strcpy (fileName, dir->directory); + strcat (fileName, bitmap->fileName); + ret = (*bitmap->renderer->GetInfoBitmap) (fpe, pFontInfo, entry, fileName); +@@ -891,10 +900,15 @@ + vals.ranges = FontParseRanges(origName, &vals.nranges); + ranges = vals.ranges; + /* Make a new scaled instance */ +- strcpy (fileName, dir->directory); +- strcat (fileName, scalable->fileName); +- ret = (*scalable->renderer->GetInfoScalable) +- (fpe, *pFontInfo, entry, &tmpName, fileName, &vals); ++ if (strlen(dir->directory) + strlen(scalable->fileName) >= ++ sizeof(fileName)) { ++ ret = BadFontName; ++ } else { ++ strcpy (fileName, dir->directory); ++ strcat (fileName, scalable->fileName); ++ ret = (*scalable->renderer->GetInfoScalable) ++ (fpe, *pFontInfo, entry, &tmpName, fileName, &vals); ++ } + if (ranges) xfree(ranges); + } + } +@@ -931,10 +945,15 @@ + bc = &entry->u.bc; + entry = bc->entry; + /* Make a new scaled instance */ +- strcpy (fileName, dir->directory); +- strcat (fileName, scalable->fileName); +- ret = (*scalable->renderer->GetInfoScalable) ++ if (strlen(dir->directory) + strlen(scalable->fileName) >= ++ sizeof(fileName)) { ++ ret = BadFontName; ++ } else { ++ strcpy (fileName, dir->directory); ++ strcat (fileName, scalable->fileName); ++ ret = (*scalable->renderer->GetInfoScalable) + (fpe, *pFontInfo, entry, tmpName, fileName, &bc->vals); ++ } + break; + #endif + default: Property changes on: head/x11-servers/XFree86-4-Server/files/patch-xc::lib::font::fontfile ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/x11-servers/XFree86-4-Server-snap/Makefile =================================================================== --- head/x11-servers/XFree86-4-Server-snap/Makefile (revision 100787) +++ head/x11-servers/XFree86-4-Server-snap/Makefile (revision 100788) @@ -1,175 +1,175 @@ # New ports collection makefile for: XFree86-Server # Date created: 10 Oct 1999 # Whom: taguchi@tohoku.iij.ad.jp # # $FreeBSD$ # PORTNAME= Server PORTVERSION= 4.3.99.15 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-servers MASTER_SITES= ${MASTER_SITE_XFREE:S|source/||:S/$/:x/} \ ${MASTER_SITE_LOCAL:S/$/:local/} MASTER_SITE_SUBDIR= develsnaps/:x \ anholt/:local PKGNAMEPREFIX= XFree86- DISTFILES= XFree86-${PORTVERSION}${EXTRACT_SUFX}:x \ Wraphelp2.gz:local EXTRACT_ONLY= XFree86-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER= x11@FreeBSD.org COMMENT= XFree86-4 X server and related programs # Override default from XFree86-4-libraries/Makefile.inc PATCHDIR= ${MASTERDIR}/files .for pf in patch-Imake.cf patch-Imake.rules \ patch-Imake.tmpl patch-X11.tmpl patch-Xcursor-Imakefile \ patch-c2 patch-dri-Imakefile \ patch-f patch-imake.c \ patch-texteroids patch-xditview-Imakefile patch-xdm \ patch-xdm_session.c patch-xf86.tmpl \ patch-xterm-Imakefile patch-z05 patch-z14 \ patch-z15 patch-z30 patch-z32 patch-z34 patch-z35 \ patch-z41 patch-z44 patch-z45 # patch-startx EXTRA_PATCHES+= ${.CURDIR}/../../x11/XFree86-4-libraries/files/${pf} .endfor NO_LATEST_LINK= yes USE_BZIP2= yes SCRIPTS_ENV= OSVERSION=${OSVERSION} \ BuildXF86DRI=${BuildXF86DRI} \ WITH_DEBUG="${WITH_DEBUG}" MAN1= XFree86.1 \ Xserver.1 \ gtf.1 \ kbd_mode.1 \ pcitweak.1 \ xf86cfg.1 \ xf86config.1 MAN3= XF86VidMode.3 \ XF86VidModeDeleteModeLine.3 \ XF86VidModeGetAllModeLines.3 \ XF86VidModeGetDotClocks.3 \ XF86VidModeGetGamma.3 \ XF86VidModeGetGammaRamp.3 \ XF86VidModeGetGammaRampSize.3 \ XF86VidModeGetModeLine.3 \ XF86VidModeGetMonitor.3 \ XF86VidModeGetPermissions.3 \ XF86VidModeGetViewPort.3 \ XF86VidModeLockModeSwitch.3 \ XF86VidModeModModeLine.3 \ XF86VidModeQueryExtension.3 \ XF86VidModeQueryVersion.3 \ XF86VidModeSetClientVersion.3 \ XF86VidModeSetGamma.3 \ XF86VidModeSetGammaRamp.3 \ XF86VidModeSetViewPort.3 \ XF86VidModeSwitchMode.3 \ XF86VidModeSwitchToMode.3 \ XF86VidModeValidateModeLine.3 MAN4= citron.4 \ dynapro.4 \ elographics.4 \ fbdevhw.4 \ kbd.4 \ keyboard.4 \ microtouch.4 \ mouse.4 \ mutouch.4 \ nv.4 \ r128.4 \ radeon.4 \ void.4 \ wacom.4 MAN5= XF86Config.5 PKGMESSAGE= ${WRKDIR}/.pkg-message XBUILD_DIRS= lib/font lib/lbxutil lib/Xdmcp lib/Xau programs/Xserver XINCLUDE_DIRS= lib/xkbfile lib/xtrans XINSTALL_DIRS= lib/font programs/Xserver XINSTALL_MAN_DIRS= programs/Xserver NOT_FOR_ARCHS= ia64 .include "${.CURDIR}/../../x11/XFree86-4-libraries/Makefile.inc" .include .if ${ARCH} == i386 || ${ARCH} == alpha RUN_DEPENDS+= ${X11BASE}/lib/modules/dri/r200_dri.so:${PORTSDIR}/graphics/dri BuildXF86DRI= YES PLIST_SUB+= DRI="" .else BuildXF86DRI= NO PLIST_SUB+= DRI="@comment " .endif .if ${ARCH} == alpha PLIST_SUB+= ALPHA_NA="@comment " .else PLIST_SUB+= ALPHA_NA="" .endif .if ${ARCH} == ia64 PLIST_SUB+= IA64_NA="@comment " .else PLIST_SUB+= IA64_NA="" .endif .if ${ARCH} == sparc64 PLIST_SUB+= SPARC64_NA="@comment " PLIST_SUB+= SPARC64="" MAN4+= sunffb.4 .else PLIST_SUB+= SPARC64="@comment " PLIST_SUB+= SPARC64_NA="" MAN4+= glint.4 \ mga.4 \ rendition.4 \ s3virge.4 \ savage.4 \ siliconmotion.4 \ tdfx.4 \ vga.4 .endif .if ${ARCH} == i386 PLIST_SUB+= I386="" MAN1+= scanpci.1 MAN4+= apm.4 \ chips.4 \ cirrus.4 \ cyrix.4 \ i128.4 \ i740.4 \ i810.4 \ neomagic.4 \ nsc.4 \ sis.4 \ trident.4 \ tseng.4 \ vesa.4 \ via.4 \ vmware.4 .else PLIST_SUB+= I386="@comment " .endif post-extract:: ${GUNZIP_CMD} -c ${DISTDIR}/${DIST_SUBDIR}/Wraphelp2.gz > \ ${WRKSRC}/lib/Xdmcp/Wraphelp.c post-build: @${RM} -f ${PKGMESSAGE} @${CAT} ${.CURDIR}/pkg-message >> ${PKGMESSAGE} post-install:: @${SED} -e s,/usr/X11R6,${PREFIX}, ${PKGMESSAGE} @if [ -f ${PREFIX}/bin/Xwrapper-4 ] ; then \ ${LN} -sf Xwrapper-4 ${PREFIX}/bin/X; \ fi; .include Property changes on: head/x11-servers/XFree86-4-Server-snap/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.149 \ No newline at end of property +1.150 \ No newline at end of property Index: head/x11-servers/XFree86-4-Server-snap/files/patch-dirfile.c =================================================================== --- head/x11-servers/XFree86-4-Server-snap/files/patch-dirfile.c (revision 100787) +++ head/x11-servers/XFree86-4-Server-snap/files/patch-dirfile.c (nonexistent) @@ -1,13 +0,0 @@ ---- lib/font/fontfile/dirfile.c.orig Fri May 31 20:45:50 2002 -+++ lib/font/fontfile/dirfile.c Thu Feb 5 00:19:57 2004 -@@ -286,6 +286,10 @@ - status = AllocError; - break; - case NAME: -+ if (strlen(lexToken) >= sizeof(alias)) { -+ status = BadFontPath; -+ break; -+ } - strcpy(alias, lexToken); - token = lexAlias(file, &lexToken); - switch (token) { Property changes on: head/x11-servers/XFree86-4-Server-snap/files/patch-dirfile.c ___________________________________________________________________ Deleted: cvs2svn:cvs-rev ## -1 +0,0 ## -1.1 \ No newline at end of property Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/x11-servers/XFree86-4-Server-snap/files/patch-xc::lib::font::fontfile =================================================================== --- head/x11-servers/XFree86-4-Server-snap/files/patch-xc::lib::font::fontfile (nonexistent) +++ head/x11-servers/XFree86-4-Server-snap/files/patch-xc::lib::font::fontfile (revision 100788) @@ -0,0 +1,185 @@ +Index: lib/font/fontfile/dirfile.c +=================================================================== +RCS file: /home/x-cvs/xc/lib/font/fontfile/dirfile.c,v +retrieving revision 3.15 +diff -u -r3.15 dirfile.c +--- dirfile.c 31 May 2002 18:45:50 -0000 3.15 ++++ dirfile.c 11 Feb 2004 21:17:20 -0000 +@@ -68,6 +68,9 @@ + + FontDirectoryPtr dir = NullFontDirectory; + ++ if (strlen(directory) + 1 + sizeof(FontDirFile) > sizeof(dir_file)) ++ return BadFontPath; ++ + #ifdef FONTDIRATTRIB + /* Check for font directory attributes */ + #ifndef __UNIXOS2__ +@@ -154,6 +157,9 @@ + char dir_file[MAXFONTFILENAMELEN]; + struct stat statb; + ++ if (strlen(dir->directory) + sizeof(FontDirFile) > sizeof(dir_file)) ++ return FALSE; ++ + strcpy (dir_file, dir->directory); + strcat (dir_file, FontDirFile); + if (stat (dir_file, &statb) == -1) +@@ -202,6 +208,8 @@ + continue; + + len = strlen (fileName) - renderer->fileSuffixLen; ++ if (len >= sizeof(copy)) ++ continue; + CopyISOLatin1Lowered (copy, fileName, len); + copy[len] = '\0'; + name.name = copy; +@@ -251,9 +259,13 @@ + int status = Successful; + struct stat statb; + ++ if (strlen(directory) >= sizeof(alias_file)) ++ return BadFontPath; + dir = *pdir; + strcpy(alias_file, directory); + if (!isFile) { ++ if (strlen(directory) + 1 + sizeof(FontAliasFile) > sizeof(alias_file)) ++ return BadFontPath; + if (directory[strlen(directory) - 1] != '/') + strcat(alias_file, "/"); + strcat(alias_file, FontAliasFile); +@@ -286,6 +298,10 @@ + status = AllocError; + break; + case NAME: ++ if (strlen(lexToken) >= sizeof(alias)) { ++ status = BadFontPath; ++ break; ++ } + strcpy(alias, lexToken); + token = lexAlias(file, &lexToken); + switch (token) { +@@ -302,6 +318,10 @@ + status = AllocError; + break; + case NAME: ++ if (strlen(lexToken) >= sizeof(font_name)) { ++ status = BadFontPath; ++ break; ++ } + CopyISOLatin1Lowered(alias, alias, strlen(alias)); + CopyISOLatin1Lowered(font_name, lexToken, strlen(lexToken)); + if (!FontFileAddFontAlias (dir, alias, font_name)) +Index: lib/font/fontfile/encparse.c +=================================================================== +RCS file: /home/x-cvs/xc/lib/font/fontfile/encparse.c,v +retrieving revision 1.18 +diff -u -r1.18 encparse.c +--- encparse.c 2 Nov 2001 03:06:40 -0000 1.18 ++++ encparse.c 11 Feb 2004 21:17:20 -0000 +@@ -833,6 +833,7 @@ + char file_name[MAXFONTFILENAMELEN], encoding_name[MAXFONTNAMELEN], + buf[MAXFONTFILENAMELEN]; + int count, n; ++ static char format[24] = ""; + + /* As we don't really expect to open encodings that often, we don't + take the trouble of caching encodings directories. */ +@@ -848,8 +849,12 @@ + } + + encoding = NULL; ++ if (!format[0]) { ++ sprintf(format, "%%%ds %%%d[^\n]\n", sizeof(encoding_name) - 1, ++ sizeof(file_name) - 1); ++ } + for(;;) { +- count = fscanf(file, "%s %[^\n]\n", encoding_name, file_name); ++ count = fscanf(file, format, encoding_name, file_name); + if(count == EOF) + break; + if(count != 2) +Index: lib/font/fontfile/fontfile.c +=================================================================== +RCS file: /home/x-cvs/xc/lib/font/fontfile/fontfile.c,v +retrieving revision 3.16 +diff -u -r3.16 fontfile.c +--- fontfile.c 31 May 2002 18:45:50 -0000 3.16 ++++ fontfile.c 11 Feb 2004 21:17:20 -0000 +@@ -424,11 +424,16 @@ + vals.ranges = ranges; + vals.nranges = nranges; + +- strcpy (fileName, dir->directory); +- strcat (fileName, scalable->fileName); +- ret = (*scalable->renderer->OpenScalable) (fpe, pFont, ++ if (strlen(dir->directory) + strlen(scalable->fileName) >= ++ sizeof(fileName)) { ++ ret = BadFontName; ++ } else { ++ strcpy (fileName, dir->directory); ++ strcat (fileName, scalable->fileName); ++ ret = (*scalable->renderer->OpenScalable) (fpe, pFont, + flags, entry, fileName, &vals, format, fmask, + non_cachable_font); ++ } + + /* In case rasterizer does something bad because of + charset subsetting... */ +@@ -497,6 +502,8 @@ + + dir = (FontDirectoryPtr) fpe->private; + bitmap = &entry->u.bitmap; ++ if (strlen(dir->directory) + strlen(bitmap->fileName) >= sizeof(fileName)) ++ return BadFontName; + strcpy (fileName, dir->directory); + strcat (fileName, bitmap->fileName); + ret = (*bitmap->renderer->OpenBitmap) +@@ -530,6 +537,8 @@ + + dir = (FontDirectoryPtr) fpe->private; + bitmap = &entry->u.bitmap; ++ if (strlen(dir->directory) + strlen(bitmap->fileName) >= sizeof(fileName)) ++ return BadFontName; + strcpy (fileName, dir->directory); + strcat (fileName, bitmap->fileName); + ret = (*bitmap->renderer->GetInfoBitmap) (fpe, pFontInfo, entry, fileName); +@@ -891,10 +900,15 @@ + vals.ranges = FontParseRanges(origName, &vals.nranges); + ranges = vals.ranges; + /* Make a new scaled instance */ +- strcpy (fileName, dir->directory); +- strcat (fileName, scalable->fileName); +- ret = (*scalable->renderer->GetInfoScalable) +- (fpe, *pFontInfo, entry, &tmpName, fileName, &vals); ++ if (strlen(dir->directory) + strlen(scalable->fileName) >= ++ sizeof(fileName)) { ++ ret = BadFontName; ++ } else { ++ strcpy (fileName, dir->directory); ++ strcat (fileName, scalable->fileName); ++ ret = (*scalable->renderer->GetInfoScalable) ++ (fpe, *pFontInfo, entry, &tmpName, fileName, &vals); ++ } + if (ranges) xfree(ranges); + } + } +@@ -931,10 +945,15 @@ + bc = &entry->u.bc; + entry = bc->entry; + /* Make a new scaled instance */ +- strcpy (fileName, dir->directory); +- strcat (fileName, scalable->fileName); +- ret = (*scalable->renderer->GetInfoScalable) ++ if (strlen(dir->directory) + strlen(scalable->fileName) >= ++ sizeof(fileName)) { ++ ret = BadFontName; ++ } else { ++ strcpy (fileName, dir->directory); ++ strcat (fileName, scalable->fileName); ++ ret = (*scalable->renderer->GetInfoScalable) + (fpe, *pFontInfo, entry, tmpName, fileName, &bc->vals); ++ } + break; + #endif + default: Property changes on: head/x11-servers/XFree86-4-Server-snap/files/patch-xc::lib::font::fontfile ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property