From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Sep 4 20:50:16 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B7EDB16A4E1 for ; Mon, 4 Sep 2006 20:50:16 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CF5043D46 for ; Mon, 4 Sep 2006 20:50:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k84KoF5L054094 for ; Mon, 4 Sep 2006 20:50:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k84KoFT2054088; Mon, 4 Sep 2006 20:50:15 GMT (envelope-from gnats) Resent-Date: Mon, 4 Sep 2006 20:50:15 GMT Resent-Message-Id: <200609042050.k84KoFT2054088@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bill Milford Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 139D216A4DE for ; Mon, 4 Sep 2006 20:48:20 +0000 (UTC) (envelope-from root@milfordmail.com) Received: from smtp102.sbc.mail.mud.yahoo.com (smtp102.sbc.mail.mud.yahoo.com [68.142.198.201]) by mx1.FreeBSD.org (Postfix) with SMTP id 9F79243D45 for ; Mon, 4 Sep 2006 20:48:19 +0000 (GMT) (envelope-from root@milfordmail.com) Received: (qmail 22223 invoked from network); 4 Sep 2006 20:48:18 -0000 Received: from unknown (HELO mail.milfordmail.com) (validateduser3@70.129.130.15 with login) by smtp102.sbc.mail.mud.yahoo.com with SMTP; 4 Sep 2006 20:48:18 -0000 Received: from root by mail.milfordmail.com with local (Exim 4.63 (FreeBSD)) (envelope-from ) id 1GKLMf-0006Yx-JF; Mon, 04 Sep 2006 15:48:17 -0500 Message-Id: Date: Mon, 04 Sep 2006 15:48:17 -0500 From: Bill Milford To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/102868: [patch] x11-servers/xorg-server will not build on 4.11 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bill Milford List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2006 20:50:16 -0000 >Number: 102868 >Category: ports >Synopsis: [patch] x11-servers/xorg-server will not build on 4.11 >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Sep 04 20:50:14 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Bill Milford >Release: FreeBSD 4.11-RELEASE-p17 i386 >Organization: >Environment: System: FreeBSD mail.milfordmail.com 4.11-RELEASE-p17 FreeBSD 4.11-RELEASE-p17 #2: Wed May 31 20:26:47 CDT 2006 bill@mail.milfordmail.com:/usr/obj/usr/src/sys/MYKERNEL2 i386 AMD K6-450 >Description: The patch added when the version became 6.9.0_5 will causes pcfread.c to not compile. This is because the patch uses INT32_MAX which is defined std_int.h for 5.x and 6.x, but not in 4.11. I have changed the patch to include limits.h and to use INT_MAX. This eliinates the build error and the code runs OK here. This is the error message received: LD_LIBRARY_PATH=/usr/ports/x11-servers/xorg-server/work/xc/exports/lib XLOCALEDIR=/usr/ports/x11-servers/xorg-server/work/xc/exports/lib/locale cc -O -pipe -ansi -pedantic -Dasm=__asm -Wall -Wpointer-arith -Wundef -fPIC -I/usr/ports/x11-servers/xorg-server/work/xc/include/fonts -I../../include -I/usr/ports/x11-servers/xorg-server/work/xc/programs/Xserver/include -I/usr/ports/x11-servers/xorg-server/work/xc/exports/include/X11 -I../ -I/usr/ports/x11-servers/xorg-server/work/xc -I/usr/ports/x11-servers/xorg-server/work/xc/exports/include -I/usr/X11R6/include -I/usr/X11R6/include -DCSRG_BASED -DSHAPE -DXINPUT -DXKB -DXAPPGROUP -DXCSECURITY -DTOGCUP -DXF86BIGFONT -DDPMSExtension -DPANORAMIX -DRENDER -DRANDR -DXFIXES -DDAMAGE -DCOMPOSITE -DXEVIE -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA -DXvExtension -DXFree86LOADER -DDLOPEN_HACK -DXFree86Server -DXF86VIDMODE -DXvMCExtension -DSMART_SCHEDULE -DBUILDDEBUG -DXResExtension -DX_BYTE_ ORDER=X_LITTLE_ENDIAN -DXORG_VERSION_CURRENT="(((6) * 10000000) + ((9) * 100000) + ((0) * 1000) + 0)" -DNDEBUG -DFUNCPROTO=15 -DNARROWPROTO -DIN_MODULE -DXFree86Module -DFONTMODULE -DBDFFORMAT -DSNFFORMAT -DPCFFORMAT -c pcfread.c In file included from pcfread.c:48: /usr/include/stdint.h:75: redefinition of `xf86gid_t' /usr/ports/x11-servers/xorg-server/work/xc/programs/Xserver/include/xf86_libc.h:90: `xf86gid_t' previously declared here /usr/include/stdint.h:80: conflicting types for `xf86mode_t' /usr/ports/x11-servers/xorg-server/work/xc/programs/Xserver/include/xf86_libc.h:88: previous declaration of `xf86mode_t' /usr/include/stdint.h:92: redefinition of `xf86uid_t' /usr/ports/x11-servers/xorg-server/work/xc/programs/Xserver/include/xf86_libc.h:89: `xf86uid_t' previously declared here /usr/include/stdint.h:108: conflicting types for `xf86dev_t' /usr/ports/x11-servers/xorg-server/work/xc/programs/Xserver/include/xf86_libc.h:87: previous declaration of `xf86dev_t' In file included from pcfread.c:48: /usr/include/stdint.h:144: conflicting types for `xf86ssize_t' /usr/ports/x11-servers/xorg-server/work/xc/programs/Xserver/include/xf86_libc.h:86: previous declaration of `xf86ssize_t' pcfread.c: In function `pcfReadTOC': pcfread.c:137: `INT32_MAX' undeclared (first use in this function) pcfread.c:137: (Each undeclared identifier is reported only once pcfread.c:137: for each function it appears in.) pcfread.c: In function `pcfGetProperties': pcfread.c:260: `INT32_MAX' undeclared (first use in this function) pcfread.c: In function `pcfReadFont': pcfread.c:442: `INT32_MAX' undeclared (first use in this function) pcfread.c: In function `pmfReadFont': pcfread.c:835: `INT32_MAX' undeclared (first use in this function) *** Error code 1 Stop in /usr/ports/x11-servers/xorg-server/work/xc/lib/font/bitmap/module. *** Error code 1 Stop in /usr/ports/x11-servers/xorg-server/work/xc/lib/font/bitmap. *** Error code 1 Stop in /usr/ports/x11-servers/xorg-server/work/xc/lib/font. *** Error code 1 Stop in /usr/ports/x11-servers/xorg-server. >How-To-Repeat: cd /usr/ports/x11-servers/xorg-server make >Fix: --- patch-font-bitmap-pcfread.patch begins here --- *** patch-font-bitmap-pcfread.c.orig Fri Aug 25 16:52:48 2006 --- patch-font-bitmap-pcfread.c Wed Aug 30 11:33:53 2006 *************** *** 2,31 **** +++ lib/font/bitmap/pcfread.c Thu Aug 24 21:56:56 2006 @@ -45,6 +45,7 @@ #endif #include ! +#include void pcfError(const char* message, ...) @@ -133,6 +134,10 @@ return (PCFTablePtr) NULL; count = pcfGetLSB32(file); if (IS_EOF(file)) return (PCFTablePtr) NULL; ! + if (count < 0 || count > INT32_MAX / sizeof(PCFTableRec)) { + pcfError("pcfReadTOC(): invalid file format\n"); + return NULL; + } tables = (PCFTablePtr) xalloc(count * sizeof(PCFTableRec)); if (!tables) { pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec)); @@ -252,6 +257,10 @@ if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) goto Bail; nprops = pcfGetINT32(file, format); ! + if (nprops <= 0 || nprops > INT32_MAX / sizeof(FontPropRec)) { + pcfError("pcfGetProperties(): invalid nprops value (%d)\n", nprops); + goto Bail; + } if (IS_EOF(file)) goto Bail; props = (FontPropPtr) xalloc(nprops * sizeof(FontPropRec)); --- 2,31 ---- +++ lib/font/bitmap/pcfread.c Thu Aug 24 21:56:56 2006 @@ -45,6 +45,7 @@ #endif #include ! +#include void pcfError(const char* message, ...) @@ -133,6 +134,10 @@ return (PCFTablePtr) NULL; count = pcfGetLSB32(file); if (IS_EOF(file)) return (PCFTablePtr) NULL; ! + if (count < 0 || count > INT_MAX / sizeof(PCFTableRec)) { + pcfError("pcfReadTOC(): invalid file format\n"); + return NULL; + } tables = (PCFTablePtr) xalloc(count * sizeof(PCFTableRec)); if (!tables) { pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec)); @@ -252,6 +257,10 @@ if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) goto Bail; nprops = pcfGetINT32(file, format); ! + if (nprops <= 0 || nprops > INT_MAX / sizeof(FontPropRec)) { + pcfError("pcfGetProperties(): invalid nprops value (%d)\n", nprops); + goto Bail; + } if (IS_EOF(file)) goto Bail; props = (FontPropPtr) xalloc(nprops * sizeof(FontPropRec)); *************** *** 54,64 **** if (!strings) { @@ -422,6 +439,10 @@ else nmetrics = pcfGetINT16(file, format); if (IS_EOF(file)) goto Bail; ! + if (nmetrics < 0 || nmetrics > INT32_MAX / sizeof(CharInfoRec)) { + pcfError("pcfReadFont(): invalid file format\n"); + goto Bail; + } metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); if (!metrics) { --- 54,64 ---- if (!strings) { @@ -422,6 +439,10 @@ else nmetrics = pcfGetINT16(file, format); if (IS_EOF(file)) goto Bail; ! + if (nmetrics < 0 || nmetrics > INT_MAX / sizeof(CharInfoRec)) { + pcfError("pcfReadFont(): invalid file format\n"); + goto Bail; + } metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); if (!metrics) { *************** *** 90,100 **** pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo)); @@ -809,6 +832,10 @@ else nmetrics = pcfGetINT16(file, format); if (IS_EOF(file)) goto Bail; ! + if (nmetrics < 0 || nmetrics > INT32_MAX / sizeof(CharInfoRec)) { + pcfError("pmfReadFont(): invalid file format\n"); + goto Bail; + } metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); if (!metrics) { --- 90,100 ---- pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo)); @@ -809,6 +832,10 @@ else nmetrics = pcfGetINT16(file, format); if (IS_EOF(file)) goto Bail; ! + if (nmetrics < 0 || nmetrics > INT_MAX / sizeof(CharInfoRec)) { + pcfError("pmfReadFont(): invalid file format\n"); + goto Bail; + } metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); if (!metrics) { --- patch-font-bitmap-pcfread.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: