+++ /dev/null
-tigervnc (1.3.0-3ubuntu1) precise; urgency=low
-
- * Build Xvnc against native upstream xorg sources, using native config
- options. Use distro-specific fltk1.3 sources.
-
- -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 14 Jul 2013 15:22:28 -0400
-
-tigervnc (1.3.0-3) precise; urgency=low
-
- * Additional dependencies (derived from ldd | dpkg -S).
-
- -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 11:01:33 -0400
-
-tigervnc (1.3.0-2) precise; urgency=low
-
- * Added build dependencies to improve font support in viewer.
-
- -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 10:44:05 -0400
-
-tigervnc (1.3.0-1) precise; urgency=low
-
- * Removed java viewer from server package. Fixed typo in server
- dependencies.
-
- -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 09:55:44 -0400
-
-tigervnc (1.3.0) precise; urgency=low
-
- * Initial release.
-
- -- Brian P. Hinz <bphinz@users.sourceforge.net> Fri, 05 Jul 2013 00:47:02 -0400
+++ /dev/null
-Source: tigervnc
-Section: x11
-Priority: optional
-Maintainer: Brian P. Hinz <bphinz@users.sourceforge.net>
-Standards-Version: 3.8.4
-Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls28-dev, libpam0g-dev, libpng-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xcmisc-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86misc-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libt1-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libxdamage-dev, libgcrypt11-dev
-Homepage: http://www.tigervnc.com
-
-Package: tigervncserver
-Architecture: any
-Provides: xserver, vnc-server
-Depends: x11-common | xserver-common, x11-utils, xauth, libbz2-1.0, libc6, libfontenc1, libfreetype6, libgcc1, libgl1-mesa-dri, libgnutls28, libjpeg-turbo8, libp11-kit0, libpam0g, libpixman-1-0, libstdc++6, libtasn1-3, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxfont1, libxtst6, zlib1g, libglu1-mesa, libxcursor1, libxinerama1, libxfixes3, x11-xkb-utils, libgcrypt11
-Recommends: xfonts-base, x11-xserver-utils
-Suggests: xtigervncviewer, tigervnc-java
-Description: virtual network computing server software
- Virtual Network Computing (VNC) is a remote display system which allows you to
- view and interact with a virtual desktop environment that is running on another
- computer on the network. Using VNC, you can run graphical applications on a
- remote machine and send only the display from these applications to your local
- machine. VNC is platform-independent and supports a wide variety of operating
- systems and architectures as both servers and clients.
- .
- TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
- bases. TigerVNC started as a next-generation development effort for TightVNC
- on Unix and Linux platforms, but it split from its parent project in early 2009
- so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
- of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
- JPEG codec.
-
-Package: xtigervncviewer
-Architecture: any
-Provides: vncviewer, vnc-viewer
-Depends: libc6, libexpat1, libfontconfig1, libfreetype6, libgcc1, libgnutls28, libjpeg-turbo8, libp11-kit0, libpng12-0, libstdc++6, libtasn1-3, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxft2, libxrender1, zlib1g, libglu1-mesa
-Recommends: xfonts-base
-Suggests: tigervncserver, ssh
-Description: virtual network computing client software for X
- Virtual Network Computing (VNC) is a remote display system which allows you to
- view and interact with a virtual desktop environment that is running on another
- computer on the network. Using VNC, you can run graphical applications on a
- remote machine and send only the display from these applications to your local
- machine. VNC is platform-independent and supports a wide variety of operating
- systems and architectures as both servers and clients.
- .
- TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
- bases. TigerVNC started as a next-generation development effort for TightVNC
- on Unix and Linux platforms, but it split from its parent project in early 2009
- so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
- of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
- JPEG codec.
-
-Package: tigervnc-java
-Architecture: any
-Suggests: tigervncserver
-Provides: vncviewer, vnc-viewer
-Depends: default-jre
-Description: TigerVNC java applet
- Virtual Network Computing (VNC) is a remote display system which allows you to
- view and interact with a virtual desktop environment that is running on another
- computer on the network. Using VNC, you can run graphical applications on a
- remote machine and send only the display from these applications to your local
- machine. VNC is platform-independent and supports a wide variety of operating
- systems and architectures as both servers and clients.
- .
- TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
- bases. TigerVNC started as a next-generation development effort for TightVNC
- on Unix and Linux platforms, but it split from its parent project in early 2009
- so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
- of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
- JPEG codec.
-
+++ /dev/null
-This package was packaged for Debian by Brian P. Hinz <bphinz@users.sourceforge.net>
-on Tue, 02 Jul 2013 21:33:24 +0500 using the tightvnc package as a base.
-
-It was downloaded from:
- https://www.tigervnc.org/
-
-COPYRIGHT:
-==========
-
-TigerVNC is
-
- Copyright (C) 1999 AT&T Laboratories Cambridge
- Copyright (C) 2002-2005 RealVNC Ltd.
- Copyright (C) 2000-2006 TightVNC Group
- Copyright (C) 2005-2006 Martin Koegler
- Copyright (C) 2005-2006 Sun Microsystems, Inc.
- Copyright (C) 2006 OCCAM Financial Technology
- Copyright (C) 2000-2008 Constantin Kaplinsky
- Copyright (C) 2004-2009 Peter Astrand for Cendio AB
- Copyright (C) 2010 Antoine Martin
- Copyright (C) 2010 m-privacy GmbH
- Copyright (C) 2009-2011 D. R. Commander
- Copyright (C) 2009-2011 Pierre Ossman for Cendio AB
- Copyright (C) 2004, 2009-2011 Red Hat, Inc.
- Copyright (C) 2009-2011 TigerVNC Team
- All Rights Reserved.
-
-This software is distributed under the GNU General Public Licence as published
-by the Free Software Foundation. See the file LICENCE.TXT for the conditions
-under which this software is made available. TigerVNC also contains code from
-other sources. See the Acknowledgements section below, and the individual
-source files, for details of the conditions under which they are made
-available.
-
-ACKNOWLEDGEMENTS
-================
-
-This distribution contains zlib compression software. This is:
-
- Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-
-
-This distribution contains public domain DES software by Richard Outerbridge.
-This is:
-
- Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
- (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
-
-
-This distribution contains software from the X Window System. This is:
-
- Copyright 1987, 1988, 1998 The Open Group
-
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation.
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of The Open Group shall not be
- used in advertising or otherwise to promote the sale, use or other dealings
- in this Software without prior written authorization from The Open Group.
-
-
- Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted,
- provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in
- supporting documentation, and that the name of Digital not be
- used in advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
-
- DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- SOFTWARE.
+++ /dev/null
-#!/bin/bash
-
-#curl -L -o tigervnc-1.3.0.tar.bz2 "http://downloads.sourceforge.net/project/tigervnc/tigervnc/1.3.0/tigervnc-1.3.0.tar.bz2"
-#tar xjf tigervnc-*.tar.bz2
-#rm tigervnc-*.tar.bz2
-curl -OL http://sourceforge.net/code-snapshots/svn/t/ti/tigervnc/code/tigervnc-code-5136-trunk.zip
-unzip tigervnc-code-*-trunk.zip
-mv tigervnc-code-*-trunk tigervnc-1.3.80
-rm tigervnc-code-*-trunk.zip
-pushd tigervnc-*
-curl -L -o fltk-1.3.2-source.tar.gz 'http://anonscm.debian.org/gitweb/?p=users/ucko/fltk1.3.git;a=snapshot;h=HEAD;sf=tgz'
-tar xzf fltk-*-source.tar.gz
-rm fltk-*-source.tar.gz
-mv fltk1.3-* fltk-1.3.2
-pushd fltk-*
-sh ../../debian/patch_fltk.sh
-find . -name "*.orig" -exec rm {} \;
-popd
-curl -L -o xorg-server-1.11.4-0ubuntu10.3.tar.gz 'http://anonscm.debian.org/gitweb/?p=pkg-xorg/xserver/xorg-server.git;a=snapshot;h=cbf435a091906484112f5c4cf35b17738e779ce9;sf=tgz'
-tar xzf xorg-server-*.tar.gz
-rm xorg-server-*.tar.gz
-pushd xorg-server-*
-QUILT_PATCHES=debian/patches quilt push -a
-popd
-cp -r xorg-server-*/* unix/xserver
-rm -rf xorg-server-*
-pushd unix/xserver
-for all in `find . -type f -perm -001`; do
- chmod -x "$all"
-done
-patch -p1 -b --suffix .vnc < ../xserver111.patch
-popd
-popd
-if [ -e tigervnc_1.3.80.orig.tar.gz ] ; then
- rm tigervnc_1.3.80.orig.tar.gz
-fi
-tar czf tigervnc_1.3.80.orig.tar.gz tigervnc-1.3.80
-rm -rf tigervnc-1.3.80
+++ /dev/null
-#!/bin/bash
-#
-# Init file for TigerVNC Server
-#
-# chkconfig: - 91 35
-# description: TigerVNC remote X administration daemon.
-#
-# processname: Xvnc
-
-### BEGIN INIT INFO
-# Provides: vncservers
-# Required-Start: networking
-# Required-Stop: networking
-# Default-Start:
-# Default-Stop: 0 1 2 3 4 5 6
-# Short-Description: Starts and stops vncserver
-# Description: Used to provide remote X administration services.
-### END INIT INFO
-
-# Source function library.
-. /lib/lsb/init-functions
-
-### Default variables
-SYSCONFIG="/etc/default/vncservers"
-VNCSERVERS=""
-
-### Read configuration
-[ -r "$SYSCONFIG" ] && . "$SYSCONFIG"
-
-RETVAL=0
-prog=$"VNC server"
-
-start() {
- echo -n $"Starting $prog: "
- ulimit -S -c 0 >/dev/null 2>&1
- for display in ${VNCSERVERS}; do
- echo -n "${display} "
- if [ -r $(eval echo ~${display##*:})/.vnc/passwd ]; then
- unset BASH_ENV ENV
- log_begin_msg "Starting VNC Server for user ${display##*:}:"
- su ${display##*:} -c "cd ~${display##*:} && [ -f .vnc/passwd ] && vncserver :${display%%:*} ${VNCSERVERARGS[${display%:*}]}"
- RETVAL="$?"
- if [ "$RETVAL" -ne 0 ]; then
- log_end_msg 1
- break
- else
- log_end_msg 0
- fi
- else
- log_begin_msg "Not starting VNC Server for user ${display##*:}.\n File \"~${display##*:}/.vnc/passwd\" not found.\n Create a password file for the VNC server with vncpasswd"
- log_end_msg 1
- fi
- done
- echo
- [ "$RETVAL" -eq 0 ] && touch "/var/lock/vncserver"
- return $RETVAL
-}
-
-stop() {
- echo -n $"Shutting down $desc: "
- for display in ${VNCSERVERS}; do
- echo -n "${display} "
- unset BASH_ENV ENV
- log_begin_msg "Shutting down VNC Server for user ${display##*:}: "
- su ${display##*:} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
- RETVAL="$?"
- [ "$RETVAL" -eq 0 ] && log_end_msg 0 || log_end_msg 1
- done
- echo
- [ "$RETVAL" -eq 0 ] && rm -f "/var/lock/vncserver"
- return $RETVAL
-}
-
-restart() {
- stop
- start
-}
-
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart|reload)
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart}"
- RETVAL=1
-esac
-
-exit $RETVAL
+++ /dev/null
-# The VNCSERVERS variable is a list of display:user pairs.
-#
-# Uncomment the lines below to start a VNC server on display :2
-# as my 'myusername' (adjust this to your own). You will also
-# need to set a VNC password; run 'man vncpasswd' to see how
-# to do that.
-#
-# DO NOT RUN THIS SERVICE if your local area network is
-# untrusted! For a secure way of using VNC, see this URL:
-# http://kbase.redhat.com/faq/docs/DOC-7028
-
-# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
-
-# Use "-localhost" to prevent remote VNC clients connecting except when
-# doing so through a secure tunnel. See the "-via" option in the
-# `man vncviewer' manual page.
-
-# VNCSERVERS="2:myusername"
-# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
+++ /dev/null
-#!/bin/bash
-set -e
-apply_patch()
-{
- rm -f $2
- curl -OL http://www.fltk.org/strfiles/$1/$2
- patch -p1 < $2
-}
-
-# Export dead key information from FLTK to the apps
-# http://www.fltk.org/str.php?L2599
-apply_patch 2599 fltk-1_v4.3.x-keyboard-x11.patch
-apply_patch 2599 fltk-1_v4.3.x-keyboard-win32.patch
-apply_patch 2599 fltk-1_v6.3.x-keyboard-osx.patch
-
-# Notify applications of changes to the clipboard
-# http://www.fltk.org/str.php?L2636
-apply_patch 2636 fltk-1.3.x-clipboard.patch
-apply_patch 2636 fltk-1_v6.3.x-clipboard-x11.patch
-apply_patch 2636 fltk-1_v3.3.x-clipboard-win32-fix.patch
-apply_patch 2636 fltk-1_v2.3.x-clipboard-win32.patch
-apply_patch 2636 fltk-1_v2.3.x-clipboard-osx.patch
-
-# Ability to convert a Fl_Pixmap to a Fl_RGB_Image
-# http://www.fltk.org/str.php?L2659
-apply_patch 2659 pixmap_v2.patch
-
-# Support for custom cursors
-# http://www.fltk.org/str.php?L2660
-apply_patch 2660 fltk-1_v5.3.x-cursor.patch
-
-# Improve modality interaction with WM
-# http://www.fltk.org/str.php?L2802
-apply_patch 2802 fltk-1_v2.3.0-modal.patch
-
-# Window icons
-# http://www.fltk.org/str.php?L2816
-apply_patch 2816 fltk-1_v3.3.0-icons.patch
-
-# Multihead
-# http://fltk.org/str.php?L2860
-apply_patch 2860 fltk-1.3.x-screen_num.patch
-apply_patch 2860 fltk-1_v3.3.x-multihead.patch
-
-# Apply DRC's patches to FLTK
-curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=1' -o 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch
-curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=2' -o 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch
-curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=3' -o 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch
-
-patch -p1 -i 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch
-patch -p1 -i 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch
-patch -p1 -i 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch
+++ /dev/null
---- a/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:05:29.963390223 -0400
-+++ b/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:04:12.840357191 -0400
-@@ -250,7 +250,7 @@
- #if XORG < 111
- AbortDDX()
- #else
--AbortDDX(enum ExitCode error)
-+SigAbortDDX(int signo, enum ExitCode error)
- #endif
- {
- #if XORG < 111
-@@ -260,6 +260,14 @@
- #endif
- }
-
-+#if XORG >= 111
-+void
-+AbortDDX(enum ExitCode error)
-+{
-+ SigAbortDDX(0, error);
-+}
-+#endif
-+
- #ifdef __DARWIN__
- void
- DarwinHandleGUI(int argc, char *argv[])
+++ /dev/null
---- a/unix/xserver/man/Makefile.am 2013-03-30 17:51:01.707258746 -0400
-+++ b/unix/xserver/man/Makefile.am 2013-03-30 17:51:47.606569692 -0400
-@@ -2,5 +2,7 @@
- # (i.e. those handled in the os/utils.c options processing instead of in
- # the DDX-level options processing)
-
-+if ENABLE_DOCS
- include $(top_srcdir)/manpages.am
- appman_PRE = Xserver.man
-+endif ENABLE_DOCS
+++ /dev/null
---- a/ltmain.sh 2016-05-11 23:23:25.796742323 -0400
-+++ b/ltmain.sh 2016-05-11 23:24:47.173010324 -0400
-@@ -6447,6 +6447,9 @@
- # It is a libtool convenience library, so add in its objects.
- func_append convenience " $ladir/$objdir/$old_library"
- func_append old_convenience " $ladir/$objdir/$old_library"
-+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
-+ func_fatal_error "\`$lib' is not a convenience library"
-+ fi
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
-@@ -6457,9 +6460,6 @@
- fi
- func_append tmp_libs " $deplib"
- done
-- elif test "$linkmode" != prog && test "$linkmode" != lib; then
-- func_fatal_error "\`$lib' is not a convenience library"
-- fi
- continue
- fi # $pass = conv
-
---- a/m4/libtool.m4 2016-05-11 23:26:23.801328557 -0400
-+++ b/m4/libtool.m4 2016-05-11 23:27:12.701489603 -0400
-@@ -4589,9 +4589,6 @@
- ;;
- esac
- ;;
-- linux* | k*bsd*-gnu | gnu*)
-- _LT_TAGVAR(link_all_deplibs, $1)=no
-- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
-@@ -4654,9 +4651,6 @@
- openbsd*)
- with_gnu_ld=no
- ;;
-- linux* | k*bsd*-gnu | gnu*)
-- _LT_TAGVAR(link_all_deplibs, $1)=no
-- ;;
- esac
-
- _LT_TAGVAR(ld_shlibs, $1)=yes
-@@ -5055,7 +5049,6 @@
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
-- _LT_TAGVAR(link_all_deplibs, $1)=no
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
+++ /dev/null
-## Patches with a number < 100 are applied in debian.
-## Ubuntu patches start with 100.
-
-# Ubuntu patches
-100_rethrow_signals.patch
-
-# Upstream patches
-516_tigervnc-xorg-manpages.patch
+++ /dev/null
-#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 by Joey Hess.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-#DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-#DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
- confflags += --build=$(DEB_HOST_GNU_TYPE)
-else
- confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-endif
-SOURCE_NAME := tigervnc
-SOURCE_VERSION := $(shell dpkg-parsechangelog | awk -F': ' '/^Version: / {print $$2}')
-BUILDER=For technical support please see http://sourceforge.net/projects/tigervnc/support
-
-
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -g -O2 -fPIC
-endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
- INSTALL_PROGRAM += -s
-endif
-
-export CC = gcc
-
-get-orig-source: $(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz
- @
-
-$(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz:
- $(CURDIR)/get-orig-source.sh
-
-configure: config-stamp
-config-stamp:
- dh_testdir
- # Add here commands to configure the package.
- (cd fltk-*;cmake -G"Unix Makefiles" \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_BUILD_TYPE=Release \
- -DOPTION_PREFIX_LIB=/usr/lib \
- -DOPTION_PREFIX_CONFIG=/usr/lib \
- -DOPTION_BUILD_EXAMPLES=off \
- -DOPTION_USE_SYSTEM_LIBPNG=on;make)
- cmake -G"Unix Makefiles" \
- -DBUILD_STATIC=off \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DFLTK_LIBRARIES="$(CURDIR)/fltk-1.3.4-1/lib/libfltk.a;$(CURDIR)/fltk-1.3.4-1/lib/libfltk_images.a;-lpng" \
- -DFLTK_INCLUDE_DIR=$(CURDIR)/fltk-1.3.4-1
- (cd unix/xserver; \
- export PIXMANINCDIR=/usr/include/pixman-1; \
- autoreconf -fiv; \
- patch -p1 -i ../../debian/patches/debian_libtool.patch; \
- ./configure --prefix=/usr \
- --disable-silent-rules \
- --disable-static \
- --without-dtrace \
- --disable-strict-compilation \
- --disable-debug \
- --disable-unit-tests \
- --with-int10=x86emu \
- --with-extra-module-dir="/usr/lib/${DEB_HOST_MULTIARCH}/xorg/extra-modules,/usr/lib/xorg/extra-modules" \
- --with-os-vendor="$(VENDOR)" \
- --with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(BUILDER))" \
- --with-xkb-path=/usr/share/X11/xkb \
- --with-xkb-output=/var/lib/xkb \
- --with-default-xkb-rules=evdev \
- --disable-devel-docs \
- --disable-install-libxf86config \
- --enable-mitshm \
- --enable-xres \
- --disable-xcsecurity \
- --disable-xcalibrate \
- --disable-tslib \
- --enable-dbe \
- --disable-xf86bigfont \
- --disable-dpms \
- --disable-config-dbus \
- --disable-config-hal \
- --disable-config-udev \
- --disable-xorg \
- --disable-xquartz \
- --disable-xwin \
- --disable-xfake \
- --disable-install-setuid \
- --enable-gestures \
- --with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins" \
- --enable-aiglx \
- --enable-glx-tls \
- --enable-registry \
- --enable-composite \
- --enable-record \
- --enable-xv \
- --enable-xvmc \
- --enable-dga \
- --enable-screensaver \
- --enable-xdmcp \
- --enable-xdm-auth-1 \
- --enable-glx \
- --disable-dri --enable-dri2 \
- --enable-xinerama \
- --enable-xf86vidmode \
- --enable-xace \
- --disable-selinux \
- --enable-xfree86-utils \
- --disable-dmx \
- --disable-xvfb \
- --disable-xnest \
- --disable-kdrive \
- --disable-xephyr \
- --enable-xfbdev \
- --with-sha1=libgcrypt \
- --enable-xcsecurity \
- --disable-docs \
- --disable-selective-werror)
- touch config-stamp
-
-build-arch: config-stamp build-arch-stamp
-build-arch-stamp:
- dh_testdir
-
- # Add here command to compile/build the package.
- # Build first things.
- # Build Xvnc
- make LDFLAGS="-lpng"
- (cd unix/xserver;make)
-
- touch build-arch-stamp
-
-build-indep: config-stamp build-indep-stamp
-build-indep-stamp:
- dh_testdir
-
- # Add here command to compile/build the arch indep package.
- # It's ok not to do anything here, if you don't need to build
- # anything for this package.
- #/usr/bin/docbook-to-man debian/vnc.sgml > vnc.1
- (cd media;make)
- (cd java;cmake -G"Unix Makefiles";make)
-
- touch build-indep-stamp
-
-build: build-arch build-indep
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-arch-stamp build-indep-stamp config-stamp
-
- # Add here commands to clean up after the build process.
- dh_clean
-
-install: DH_OPTIONS=
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_prep
- dh_installdirs
- # Add here commands to install the package into debian/vnc.
- # tigervncserver
- make install DESTDIR=$(CURDIR)/debian/tigervncserver
- (cd unix/xserver/hw/vnc; make install DESTDIR=$(CURDIR)/debian/tigervncserver)
- mv $(CURDIR)/debian/tigervncserver/usr/bin/Xvnc \
- $(CURDIR)/debian/tigervncserver/usr/bin/Xtigervnc
- mv $(CURDIR)/debian/tigervncserver/usr/bin/vncconfig \
- $(CURDIR)/debian/tigervncserver/usr/bin/tigervncconfig
- mv $(CURDIR)/debian/tigervncserver/usr/bin/vncpasswd \
- $(CURDIR)/debian/tigervncserver/usr/bin/tigervncpasswd
- mv $(CURDIR)/debian/tigervncserver/usr/bin/vncserver \
- $(CURDIR)/debian/tigervncserver/usr/bin/tigervncserver
- mv $(CURDIR)/debian/tigervncserver/usr/bin/x0vncserver \
- $(CURDIR)/debian/tigervncserver/usr/bin/x0tigervncserver
- mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncconfig.1 \
- $(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncconfig.1
- mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncpasswd.1 \
- $(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncpasswd.1
- mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncserver.1 \
- $(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncserver.1
- mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0vncserver.1 \
- $(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0tigervncserver.1
- mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xvnc.1 \
- $(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xtigervnc.1
- mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-* \
- $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver
- rm $(CURDIR)/debian/tigervncserver/usr/lib/xorg/modules/extensions/libvnc.la
- rm $(CURDIR)/debian/tigervncserver/usr/bin/vncviewer
- rm $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncviewer.1
- install -o root -g root -m 755 -D $(CURDIR)/debian/local/vncserver.service \
- $(CURDIR)/debian/tigervncserver/etc/init.d/vncserver
- install -o root -g root -m 644 -D $(CURDIR)/debian/local/vncserver.sysconfig \
- $(CURDIR)/debian/tigervncserver/etc/default/vncservers
- # xtigervncviewer
- (cd vncviewer; make install DESTDIR=$(CURDIR)/debian/xtigervncviewer)
- # Install desktop stuff
- mv $(CURDIR)/debian/xtigervncviewer/usr/bin/vncviewer \
- $(CURDIR)/debian/xtigervncviewer/usr/bin/xtigervncviewer
- mv $(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/vncviewer.1 \
- $(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/xtigervncviewer.1
- # tigervnc-java
- mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share
- (cd java; make install DESTDIR=$(CURDIR)/debian/tigervnc-java/usr/share)
- #dh_movefiles
-
-# Build architecture-independent files here.
-# Pass -i to all debhelper commands in this target to reduce clutter.
-binary-indep: build install
-
-binary-indep-keep:
- dh_testdir -i
- dh_testroot -i
-# dh_installdebconf -i
- dh_install
- dh_installdocs -i
- dh_installexamples -i
- dh_installmenu -i
-# dh_installlogrotate -i
-# dh_installemacsen -i
-# dh_installpam -i
-# dh_installmime -i
-# dh_installinit -i
- dh_installcron -i
- dh_installman -i
- dh_installinfo -i
-# dh_undocumented -i
- dh_installchangelogs -i
- dh_link -i
- dh_compress -i
- dh_fixperms -i
- dh_installdeb -i
- dh_perl -i
- dh_gencontrol -i
- dh_md5sums -i
- dh_builddeb -i
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir -a
- dh_testroot -a
-# dh_installdebconf -a
- dh_installdocs -a
-# dh_installexamples -a
- dh_installmenu -a
-# dh_installlogrotate -a
-# dh_installemacsen -a
-# dh_installpam -a
-# dh_installmime -a
- dh_install
- dh_installinit -a
-# dh_installcron -a
- dh_installman -a
- dh_installinfo -a
-# dh_undocumented -a
- dh_installchangelogs -a
- # Remove empty directories
- dh_strip -a
- dh_link -a
- dh_compress -a
- dh_fixperms -a
- dh_makeshlibs -a
- dh_installdeb -a
- dh_perl -a
- dh_shlibdeps -a
- dh_gencontrol -a
- dh_md5sums -a
- dh_builddeb -a
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install get-orig-source
+++ /dev/null
-3.0 (quilt)
+++ /dev/null
-#!/bin/sh -e
-
-if [ "$1" = "configure" ]; then
- MAN=/usr/share/man/man1
- BIN=/usr/bin
- update-alternatives --install \
- $BIN/vncserver vncserver $BIN/tigervncserver 64 \
- --slave \
- $MAN/vncserver.1.gz vncserver.1.gz $MAN/tigervncserver.1.gz
- update-alternatives --install \
- $BIN/Xvnc Xvnc $BIN/Xtigervnc 74 \
- --slave \
- $MAN/Xvnc.1.gz Xvnc.1.gz $MAN/Xtigervnc.1.gz
- update-alternatives --install \
- $BIN/x0vncserver x0vncserver $BIN/x0tigervncserver 74 \
- --slave \
- $MAN/x0vncserver.1.gz x0vncserver.1.gz $MAN/x0tigervncserver.1.gz
- update-alternatives --install \
- $BIN/vncpasswd vncpasswd $BIN/tigervncpasswd 74 \
- --slave \
- $MAN/vncpasswd.1.gz vncpasswd.1.gz $MAN/tigervncpasswd.1.gz
- update-alternatives --install \
- $BIN/vncconfig vncconfig $BIN/tigervncconfig 64 \
- --slave \
- $MAN/vncconfig.1.gz vncconfig.1.gz $MAN/tigervncconfig.1.gz
-fi
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-#!/bin/sh -e
-
-if [ "$1" = "remove" ] ; then
- BIN=/usr/bin
- update-alternatives --remove \
- vncserver $BIN/tigervncserver
- update-alternatives --remove \
- Xvnc $BIN/Xtigervnc
- update-alternatives --remove \
- x0vncserver $BIN/x0tigervncserver
- update-alternatives --remove \
- vncpasswd $BIN/tigervncpasswd
- update-alternatives --remove \
- tigervncconfig $BIN/tigervncconfig
-fi
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-?package(xtigervncviewer):needs="x11" \
- section="Applications/Network/Communication" \
- hints="VNC,remote-control"\
- title="xtigervncviewer" \
- command="/usr/bin/xtigervncviewer"
+++ /dev/null
-#!/bin/sh -e
-
-if [ "$1" = "configure" ]; then
- MAN=/usr/share/man/man1
- BIN=/usr/bin
- update-alternatives --install \
- $BIN/vncviewer vncviewer $BIN/xtigervncviewer 74 \
- --slave \
- $MAN/vncviewer.1.gz vncviewer.1.gz $MAN/xtigervncviewer.1.gz \
- --slave \
- $MAN/xvncviewer.1.gz xvncviewer.1.gz $MAN/xtigervncviewer.1.gz \
- --slave \
- $BIN/xvncviewer xvncviewer $BIN/xtigervncviewer
-fi
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-#!/bin/sh -e
-
-if [ "$1" = "remove" ] ; then
- BIN=/usr/bin
- update-alternatives --remove \
- vncviewer $BIN/xtigervncviewer
-fi
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-diff -Naur xorg-server-1.12.4.orig/dbe/dbe.c xorg-server-1.12.4/dbe/dbe.c
---- xorg-server-1.12.4.orig/dbe/dbe.c 2012-05-17 19:09:01.000000000 +0200
-+++ xorg-server-1.12.4/dbe/dbe.c 2014-11-28 09:50:59.185807584 +0100
-@@ -453,18 +453,20 @@
- DbeSwapInfoPtr swapInfo;
- xDbeSwapInfo *dbeSwapInfo;
- int error;
-- register int i, j;
-- int nStuff;
-+ unsigned int i, j;
-+ unsigned int nStuff;
-
- REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
- nStuff = stuff->n; /* use local variable for performance. */
-
- if (nStuff == 0) {
-+ REQUEST_SIZE_MATCH(xDbeSwapBuffersReq);
- return Success;
- }
-
- if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec))
- return BadAlloc;
-+ REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, nStuff * sizeof(xDbeSwapInfo));
-
- /* Get to the swap info appended to the end of the request. */
- dbeSwapInfo = (xDbeSwapInfo *) &stuff[1];
-@@ -955,13 +957,16 @@
- SProcDbeSwapBuffers(ClientPtr client)
- {
- REQUEST(xDbeSwapBuffersReq);
-- register int i;
-+ unsigned int i;
- xDbeSwapInfo *pSwapInfo;
-
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
-
- swapl(&stuff->n);
-+ if (stuff->n > UINT32_MAX / sizeof(DbeSwapInfoRec))
-+ return BadAlloc;
-+ REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, stuff->n * sizeof(xDbeSwapInfo));
-
- if (stuff->n != 0) {
- pSwapInfo = (xDbeSwapInfo *) stuff + 1;
-diff -Naur xorg-server-1.12.4.orig/dix/dispatch.c xorg-server-1.12.4/dix/dispatch.c
---- xorg-server-1.12.4.orig/dix/dispatch.c 2012-05-17 19:09:01.000000000 +0200
-+++ xorg-server-1.12.4/dix/dispatch.c 2014-11-28 09:50:37.761568914 +0100
-@@ -1952,6 +1952,9 @@
- tmpImage = (char *) &stuff[1];
- lengthProto = length;
-
-+ if (lengthProto >= (INT32_MAX / stuff->height))
-+ return BadLength;
-+
- if ((bytes_to_int32(lengthProto * stuff->height) +
- bytes_to_int32(sizeof(xPutImageReq))) != client->req_len)
- return BadLength;
-diff -Naur xorg-server-1.12.4.orig/dix/region.c xorg-server-1.12.4/dix/region.c
---- xorg-server-1.12.4.orig/dix/region.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/dix/region.c 2014-11-28 09:50:45.169651442 +0100
-@@ -169,7 +169,6 @@
- ((r1)->y1 <= (r2)->y1) && \
- ((r1)->y2 >= (r2)->y2) )
-
--#define xallocData(n) malloc(RegionSizeof(n))
- #define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
-
- #define RECTALLOC_BAIL(pReg,n,bail) \
-@@ -205,8 +204,9 @@
- #define DOWNSIZE(reg,numRects) \
- if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
- { \
-- RegDataPtr NewData; \
-- NewData = (RegDataPtr)realloc((reg)->data, RegionSizeof(numRects)); \
-+ size_t NewSize = RegionSizeof(numRects); \
-+ RegDataPtr NewData = \
-+ (NewSize > 0) ? realloc((reg)->data, NewSize) : NULL ; \
- if (NewData) \
- { \
- NewData->size = (numRects); \
-@@ -330,17 +330,20 @@
- RegionRectAlloc(RegionPtr pRgn, int n)
- {
- RegDataPtr data;
-+ size_t rgnSize;
-
- if (!pRgn->data) {
- n++;
-- pRgn->data = xallocData(n);
-+ rgnSize = RegionSizeof(n);
-+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
- if (!pRgn->data)
- return RegionBreak(pRgn);
- pRgn->data->numRects = 1;
- *RegionBoxptr(pRgn) = pRgn->extents;
- }
- else if (!pRgn->data->size) {
-- pRgn->data = xallocData(n);
-+ rgnSize = RegionSizeof(n);
-+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
- if (!pRgn->data)
- return RegionBreak(pRgn);
- pRgn->data->numRects = 0;
-@@ -352,7 +355,8 @@
- n = 250;
- }
- n += pRgn->data->numRects;
-- data = (RegDataPtr) realloc(pRgn->data, RegionSizeof(n));
-+ rgnSize = RegionSizeof(n);
-+ data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL;
- if (!data)
- return RegionBreak(pRgn);
- pRgn->data = data;
-@@ -1297,6 +1301,7 @@
- {
-
- RegionPtr pRgn;
-+ size_t rgnSize;
- RegDataPtr pData;
- BoxPtr pBox;
- int i;
-@@ -1323,7 +1328,8 @@
- }
- return pRgn;
- }
-- pData = xallocData(nrects);
-+ rgnSize = RegionSizeof(nrects);
-+ pData = (rgnSize > 0) ? malloc(rgnSize) : NULL;
- if (!pData) {
- RegionBreak(pRgn);
- return pRgn;
-diff -Naur xorg-server-1.12.4.orig/glx/glxcmds.c xorg-server-1.12.4/glx/glxcmds.c
---- xorg-server-1.12.4.orig/glx/glxcmds.c 2012-08-02 02:59:23.000000000 +0200
-+++ xorg-server-1.12.4/glx/glxcmds.c 2014-11-28 09:51:59.834483171 +0100
-@@ -1948,7 +1948,7 @@
- left = (req->length << 2) - sz_xGLXRenderReq;
- while (left > 0) {
- __GLXrenderSizeData entry;
-- int extra;
-+ int extra = 0;
- __GLXdispatchRenderProcPtr proc;
- int err;
-
-@@ -1967,6 +1967,9 @@
- cmdlen = hdr->length;
- opcode = hdr->opcode;
-
-+ if (left < cmdlen)
-+ return BadLength;
-+
- /*
- ** Check for core opcodes and grab entry data.
- */
-@@ -1980,24 +1983,20 @@
- return __glXError(GLXBadRenderRequest);
- }
-
-+ if (cmdlen < entry.bytes) {
-+ return BadLength;
-+ }
-+
- if (entry.varsize) {
- /* variable size command */
- extra = (*entry.varsize) (pc + __GLX_RENDER_HDR_SIZE,
- client->swapped);
- if (extra < 0) {
-- extra = 0;
-- }
-- if (cmdlen != __GLX_PAD(entry.bytes + extra)) {
-- return BadLength;
-- }
-- }
-- else {
-- /* constant size command */
-- if (cmdlen != __GLX_PAD(entry.bytes)) {
- return BadLength;
- }
- }
-- if (left < cmdlen) {
-+
-+ if (cmdlen != safe_pad(safe_add(entry.bytes, extra))) {
- return BadLength;
- }
-
-@@ -2102,7 +2101,7 @@
- extra = (*entry.varsize) (pc + __GLX_RENDER_LARGE_HDR_SIZE,
- client->swapped);
- if (extra < 0) {
-- extra = 0;
-+ return BadLength;
- }
- /* large command's header is 4 bytes longer, so add 4 */
- if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) {
-diff -Naur xorg-server-1.12.4.orig/glx/glxcmdsswap.c xorg-server-1.12.4/glx/glxcmdsswap.c
---- xorg-server-1.12.4.orig/glx/glxcmdsswap.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/glxcmdsswap.c 2014-11-28 09:52:11.210609886 +0100
-@@ -962,11 +962,13 @@
- int
- __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- xGLXVendorPrivateReq *req;
- GLint vendorcode;
- __GLXdispatchVendorPrivProcPtr proc;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-+ REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
-
- req = (xGLXVendorPrivateReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
-@@ -989,11 +991,13 @@
- int
- __glXDispSwap_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- xGLXVendorPrivateWithReplyReq *req;
- GLint vendorcode;
- __GLXdispatchVendorPrivProcPtr proc;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-+ REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq);
-
- req = (xGLXVendorPrivateWithReplyReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
-diff -Naur xorg-server-1.12.4.orig/glx/glxserver.h xorg-server-1.12.4/glx/glxserver.h
---- xorg-server-1.12.4.orig/glx/glxserver.h 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/glxserver.h 2014-11-28 09:51:56.474445744 +0100
-@@ -218,6 +218,47 @@
- * Routines for computing the size of variably-sized rendering commands.
- */
-
-+static _X_INLINE int
-+safe_add(int a, int b)
-+{
-+ if (a < 0 || b < 0)
-+ return -1;
-+
-+ if (INT_MAX - a < b)
-+ return -1;
-+
-+ return a + b;
-+}
-+
-+static _X_INLINE int
-+safe_mul(int a, int b)
-+{
-+ if (a < 0 || b < 0)
-+ return -1;
-+
-+ if (a == 0 || b == 0)
-+ return 0;
-+
-+ if (a > INT_MAX / b)
-+ return -1;
-+
-+ return a * b;
-+}
-+
-+static _X_INLINE int
-+safe_pad(int a)
-+{
-+ int ret;
-+
-+ if (a < 0)
-+ return -1;
-+
-+ if ((ret = safe_add(a, 3)) < 0)
-+ return -1;
-+
-+ return ret & (GLuint)~3;
-+}
-+
- extern int __glXTypeSize(GLenum enm);
- extern int __glXImageSize(GLenum format, GLenum type,
- GLenum target, GLsizei w, GLsizei h, GLsizei d,
-diff -Naur xorg-server-1.12.4.orig/glx/indirect_program.c xorg-server-1.12.4/glx/indirect_program.c
---- xorg-server-1.12.4.orig/glx/indirect_program.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/indirect_program.c 2014-11-28 09:52:15.138653638 +0100
-@@ -69,6 +69,8 @@
- __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
- ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateWithReplyReq, 8);
-+
- pc += __GLX_VENDPRIV_HDR_SIZE;
- if (cx != NULL) {
- GLenum target;
-diff -Naur xorg-server-1.12.4.orig/glx/indirect_util.c xorg-server-1.12.4/glx/indirect_util.c
---- xorg-server-1.12.4.orig/glx/indirect_util.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/indirect_util.c 2014-11-28 09:52:18.662692891 +0100
-@@ -78,12 +78,17 @@
- void *local_buffer, size_t local_size, unsigned alignment)
- {
- void *buffer = local_buffer;
-- const unsigned mask = alignment - 1;
-+ const intptr_t mask = alignment - 1;
-
- if (local_size < required_size) {
-- const size_t worst_case_size = required_size + alignment;
-+ size_t worst_case_size;
- intptr_t temp_buf;
-
-+ if (required_size < SIZE_MAX - alignment)
-+ worst_case_size = required_size + alignment;
-+ else
-+ return NULL;
-+
- if (cl->returnBufSize < worst_case_size) {
- void *temp = realloc(cl->returnBuf, worst_case_size);
-
-diff -Naur xorg-server-1.12.4.orig/glx/rensize.c xorg-server-1.12.4/glx/rensize.c
---- xorg-server-1.12.4.orig/glx/rensize.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/rensize.c 2014-11-28 09:52:04.398534008 +0100
-@@ -43,19 +43,11 @@
- (((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \
- ((a & 0xff00U)<<8) | ((a & 0xffU)<<24))
-
--static int
--Map1Size(GLint k, GLint order)
--{
-- if (order <= 0 || k < 0)
-- return -1;
-- return k * order;
--}
--
- int
- __glXMap1dReqSize(const GLbyte * pc, Bool swap)
- {
- GLenum target;
-- GLint order, k;
-+ GLint order;
-
- target = *(GLenum *) (pc + 16);
- order = *(GLint *) (pc + 20);
-@@ -63,15 +55,16 @@
- target = SWAPL(target);
- order = SWAPL(order);
- }
-- k = __glMap1d_size(target);
-- return 8 * Map1Size(k, order);
-+ if (order < 1)
-+ return -1;
-+ return safe_mul(8, safe_mul(__glMap1d_size(target), order));
- }
-
- int
- __glXMap1fReqSize(const GLbyte * pc, Bool swap)
- {
- GLenum target;
-- GLint order, k;
-+ GLint order;
-
- target = *(GLenum *) (pc + 0);
- order = *(GLint *) (pc + 12);
-@@ -79,23 +72,24 @@
- target = SWAPL(target);
- order = SWAPL(order);
- }
-- k = __glMap1f_size(target);
-- return 4 * Map1Size(k, order);
-+ if (order < 1)
-+ return -1;
-+ return safe_mul(4, safe_mul(__glMap1f_size(target), order));
- }
-
- static int
- Map2Size(int k, int majorOrder, int minorOrder)
- {
-- if (majorOrder <= 0 || minorOrder <= 0 || k < 0)
-+ if (majorOrder < 1 || minorOrder < 1)
- return -1;
-- return k * majorOrder * minorOrder;
-+ return safe_mul(k, safe_mul(majorOrder, minorOrder));
- }
-
- int
- __glXMap2dReqSize(const GLbyte * pc, Bool swap)
- {
- GLenum target;
-- GLint uorder, vorder, k;
-+ GLint uorder, vorder;
-
- target = *(GLenum *) (pc + 32);
- uorder = *(GLint *) (pc + 36);
-@@ -105,15 +99,14 @@
- uorder = SWAPL(uorder);
- vorder = SWAPL(vorder);
- }
-- k = __glMap2d_size(target);
-- return 8 * Map2Size(k, uorder, vorder);
-+ return safe_mul(8, Map2Size(__glMap2d_size(target), uorder, vorder));
- }
-
- int
- __glXMap2fReqSize(const GLbyte * pc, Bool swap)
- {
- GLenum target;
-- GLint uorder, vorder, k;
-+ GLint uorder, vorder;
-
- target = *(GLenum *) (pc + 0);
- uorder = *(GLint *) (pc + 12);
-@@ -123,8 +116,7 @@
- uorder = SWAPL(uorder);
- vorder = SWAPL(vorder);
- }
-- k = __glMap2f_size(target);
-- return 4 * Map2Size(k, uorder, vorder);
-+ return safe_mul(4, Map2Size(__glMap2f_size(target), uorder, vorder));
- }
-
- /**
-@@ -175,14 +167,16 @@
- GLint bytesPerElement, elementsPerGroup, groupsPerRow;
- GLint groupSize, rowSize, padding, imageSize;
-
-+ if (w == 0 || h == 0 || d == 0)
-+ return 0;
-+
- if (w < 0 || h < 0 || d < 0 ||
- (type == GL_BITMAP &&
- (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) {
- return -1;
- }
-- if (w == 0 || h == 0 || d == 0)
-- return 0;
-
-+ /* proxy targets have no data */
- switch (target) {
- case GL_PROXY_TEXTURE_1D:
- case GL_PROXY_TEXTURE_2D:
-@@ -199,6 +193,12 @@
- return 0;
- }
-
-+ /* real data has to have real sizes */
-+ if (imageHeight < 0 || rowLength < 0 || skipImages < 0 || skipRows < 0)
-+ return -1;
-+ if (alignment != 1 && alignment != 2 && alignment != 4 && alignment != 8)
-+ return -1;
-+
- if (type == GL_BITMAP) {
- if (rowLength > 0) {
- groupsPerRow = rowLength;
-@@ -207,11 +207,14 @@
- groupsPerRow = w;
- }
- rowSize = bits_to_bytes(groupsPerRow);
-+ if (rowSize < 0)
-+ return -1;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
-- return ((h + skipRows) * rowSize);
-+
-+ return safe_mul(safe_add(h, skipRows), rowSize);
- }
- else {
- switch (format) {
-@@ -224,6 +227,11 @@
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_INTENSITY:
-+ case GL_RED_INTEGER_EXT:
-+ case GL_GREEN_INTEGER_EXT:
-+ case GL_BLUE_INTEGER_EXT:
-+ case GL_ALPHA_INTEGER_EXT:
-+ case GL_LUMINANCE_INTEGER_EXT:
- elementsPerGroup = 1;
- break;
- case GL_422_EXT:
-@@ -234,14 +242,19 @@
- case GL_DEPTH_STENCIL_MESA:
- case GL_YCBCR_MESA:
- case GL_LUMINANCE_ALPHA:
-+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- elementsPerGroup = 2;
- break;
- case GL_RGB:
- case GL_BGR:
-+ case GL_RGB_INTEGER_EXT:
-+ case GL_BGR_INTEGER_EXT:
- elementsPerGroup = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
-+ case GL_RGBA_INTEGER_EXT:
-+ case GL_BGRA_INTEGER_EXT:
- case GL_ABGR_EXT:
- elementsPerGroup = 4;
- break;
-@@ -293,6 +306,7 @@
- default:
- return -1;
- }
-+ /* known safe by the switches above, not checked */
- groupSize = bytesPerElement * elementsPerGroup;
- if (rowLength > 0) {
- groupsPerRow = rowLength;
-@@ -300,18 +314,21 @@
- else {
- groupsPerRow = w;
- }
-- rowSize = groupsPerRow * groupSize;
-+
-+ if ((rowSize = safe_mul(groupsPerRow, groupSize)) < 0)
-+ return -1;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
-- if (imageHeight > 0) {
-- imageSize = (imageHeight + skipRows) * rowSize;
-- }
-- else {
-- imageSize = (h + skipRows) * rowSize;
-- }
-- return ((d + skipImages) * imageSize);
-+
-+ if (imageHeight > 0)
-+ h = imageHeight;
-+ h = safe_add(h, skipRows);
-+
-+ imageSize = safe_mul(h, rowSize);
-+
-+ return safe_mul(safe_add(d, skipImages), imageSize);
- }
- }
-
-@@ -435,9 +452,7 @@
- /* XXX Should rowLength be used for either or both image? */
- image1size = __glXImageSize(format, type, 0, w, 1, 1,
- 0, rowLength, 0, 0, alignment);
-- image1size = __GLX_PAD(image1size);
- image2size = __glXImageSize(format, type, 0, h, 1, 1,
- 0, rowLength, 0, 0, alignment);
-- return image1size + image2size;
--
-+ return safe_add(safe_pad(image1size), image2size);
- }
-diff -Naur xorg-server-1.12.4.orig/glx/singlepix.c xorg-server-1.12.4/glx/singlepix.c
---- xorg-server-1.12.4.orig/glx/singlepix.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/singlepix.c 2014-11-28 09:51:46.254331903 +0100
-@@ -69,7 +69,7 @@
- lsbFirst = *(GLboolean *) (pc + 25);
- compsize = __glReadPixels_size(format, type, width, height);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes));
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_LSB_FIRST, lsbFirst));
-@@ -134,7 +134,7 @@
- compsize =
- __glGetTexImage_size(target, level, format, type, width, height, depth);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -232,9 +232,9 @@
- compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
-
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
- if (compsize2 < 0)
-- compsize2 = 0;
-+ return BadLength;
- compsize = __GLX_PAD(compsize);
- compsize2 = __GLX_PAD(compsize2);
-
-@@ -315,7 +315,7 @@
- */
- compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -386,7 +386,7 @@
- */
- compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -447,7 +447,7 @@
-
- compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -513,7 +513,7 @@
- */
- compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-diff -Naur xorg-server-1.12.4.orig/glx/singlepixswap.c xorg-server-1.12.4/glx/singlepixswap.c
---- xorg-server-1.12.4.orig/glx/singlepixswap.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/singlepixswap.c 2014-11-28 09:51:46.254331903 +0100
-@@ -79,7 +79,7 @@
- lsbFirst = *(GLboolean *) (pc + 25);
- compsize = __glReadPixels_size(format, type, width, height);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes));
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_LSB_FIRST, lsbFirst));
-@@ -155,7 +155,7 @@
- compsize =
- __glGetTexImage_size(target, level, format, type, width, height, depth);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -267,9 +267,9 @@
- compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
-
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
- if (compsize2 < 0)
-- compsize2 = 0;
-+ return BadLength;
- compsize = __GLX_PAD(compsize);
- compsize2 = __GLX_PAD(compsize2);
-
-@@ -358,7 +358,7 @@
- */
- compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -437,7 +437,7 @@
- */
- compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -505,7 +505,7 @@
-
- compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-@@ -577,7 +577,7 @@
- */
- compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
- if (compsize < 0)
-- compsize = 0;
-+ return BadLength;
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes));
- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
-diff -Naur xorg-server-1.12.4.orig/glx/swap_interval.c xorg-server-1.12.4/glx/swap_interval.c
---- xorg-server-1.12.4.orig/glx/swap_interval.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/swap_interval.c 2014-11-28 09:52:15.138653638 +0100
-@@ -50,6 +50,8 @@
- __GLXcontext *cx;
- GLint interval;
-
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 4);
-+
- cx = __glXLookupContextByTag(cl, tag);
-
- if ((cx == NULL) || (cx->pGlxScreen == NULL)) {
-diff -Naur xorg-server-1.12.4.orig/glx/unpack.h xorg-server-1.12.4/glx/unpack.h
---- xorg-server-1.12.4.orig/glx/unpack.h 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/unpack.h 2014-11-28 09:51:49.594369108 +0100
-@@ -83,7 +83,8 @@
- ** pointer.
- */
- #define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
-- if ((size) > sizeof(answerBuffer)) { \
-+ if (size < 0) return BadLength; \
-+ else if ((size) > sizeof(answerBuffer)) { \
- int bump; \
- if ((cl)->returnBufSize < (size)+(align)) { \
- (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
-diff -Naur xorg-server-1.12.4.orig/hw/xfree86/dri2/dri2ext.c xorg-server-1.12.4/hw/xfree86/dri2/dri2ext.c
---- xorg-server-1.12.4.orig/hw/xfree86/dri2/dri2ext.c 2012-05-17 19:09:03.000000000 +0200
-+++ xorg-server-1.12.4/hw/xfree86/dri2/dri2ext.c 2014-11-28 09:50:54.413754423 +0100
-@@ -263,6 +263,9 @@
- unsigned int *attachments;
-
- REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4);
-+ if (stuff->count > (INT_MAX / 4))
-+ return BadLength;
-+
- if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess,
- &pDrawable, &status))
- return status;
-diff -Naur xorg-server-1.12.4.orig/include/dix.h xorg-server-1.12.4/include/dix.h
---- xorg-server-1.12.4.orig/include/dix.h 2012-05-17 19:09:04.000000000 +0200
-+++ xorg-server-1.12.4/include/dix.h 2014-11-28 09:50:49.805703089 +0100
-@@ -74,7 +74,8 @@
-
- #define REQUEST_FIXED_SIZE(req, n)\
- if (((sizeof(req) >> 2) > client->req_len) || \
-- (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
-+ ((n >> 2) >= client->req_len) || \
-+ ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
- return(BadLength)
-
- #define LEGAL_NEW_RESOURCE(id,client)\
-diff -Naur xorg-server-1.12.4.orig/include/regionstr.h xorg-server-1.12.4/include/regionstr.h
---- xorg-server-1.12.4.orig/include/regionstr.h 2012-05-17 19:09:04.000000000 +0200
-+++ xorg-server-1.12.4/include/regionstr.h 2014-11-28 09:50:45.169651442 +0100
-@@ -127,7 +127,10 @@
- static inline size_t
- RegionSizeof(int n)
- {
-- return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
-+ if (n < ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec)))
-+ return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
-+ else
-+ return 0;
- }
-
- static inline void
-@@ -138,9 +141,10 @@
- (_pReg)->data = (RegDataPtr) NULL;
- }
- else {
-+ size_t rgnSize;
- (_pReg)->extents = RegionEmptyBox;
-- if (((_size) > 1) && ((_pReg)->data =
-- (RegDataPtr) malloc(RegionSizeof(_size)))) {
-+ if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) &&
-+ (((_pReg)->data = malloc(rgnSize)) != NULL)) {
- (_pReg)->data->size = (_size);
- (_pReg)->data->numRects = 0;
- }
-diff -Naur xorg-server-1.12.4.orig/os/access.c xorg-server-1.12.4/os/access.c
---- xorg-server-1.12.4.orig/os/access.c 2012-05-17 19:09:04.000000000 +0200
-+++ xorg-server-1.12.4/os/access.c 2014-11-28 09:50:41.409609554 +0100
-@@ -1331,6 +1331,10 @@
- for (host = validhosts; host; host = host->next) {
- nHosts++;
- n += pad_to_int32(host->len) + sizeof(xHostEntry);
-+ /* Could check for INT_MAX, but in reality having more than 1mb of
-+ hostnames in the access list is ridiculous */
-+ if (n >= 1048576)
-+ break;
- }
- if (n) {
- *data = ptr = malloc(n);
-@@ -1339,6 +1343,8 @@
- }
- for (host = validhosts; host; host = host->next) {
- len = host->len;
-+ if ((ptr + sizeof(xHostEntry) + len) > (data + n))
-+ break;
- ((xHostEntry *) ptr)->family = host->family;
- ((xHostEntry *) ptr)->length = len;
- ptr += sizeof(xHostEntry);
-diff -Naur xorg-server-1.12.4.orig/os/rpcauth.c xorg-server-1.12.4/os/rpcauth.c
---- xorg-server-1.12.4.orig/os/rpcauth.c 2012-05-17 19:09:04.000000000 +0200
-+++ xorg-server-1.12.4/os/rpcauth.c 2014-11-28 09:50:32.861514326 +0100
-@@ -66,6 +66,10 @@
- SVCXPRT xprt;
-
- temp_inmsg = malloc(len);
-+ if (temp_inmsg == NULL) {
-+ why = AUTH_FAILED; /* generic error, since there is no AUTH_BADALLOC */
-+ return NULL;
-+ }
- memmove(temp_inmsg, inmsg, len);
-
- memset((char *) &msg, 0, sizeof(msg));
-diff -Naur xorg-server-1.12.4.orig/randr/rrsdispatch.c xorg-server-1.12.4/randr/rrsdispatch.c
---- xorg-server-1.12.4.orig/randr/rrsdispatch.c 2012-05-17 19:09:05.000000000 +0200
-+++ xorg-server-1.12.4/randr/rrsdispatch.c 2014-11-28 09:51:10.885937921 +0100
-@@ -27,6 +27,7 @@
- {
- REQUEST(xRRQueryVersionReq);
-
-+ REQUEST_SIZE_MATCH(xRRQueryVersionReq);
- swaps(&stuff->length);
- swapl(&stuff->majorVersion);
- swapl(&stuff->minorVersion);
-@@ -38,6 +39,7 @@
- {
- REQUEST(xRRGetScreenInfoReq);
-
-+ REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
- swaps(&stuff->length);
- swapl(&stuff->window);
- return (*ProcRandrVector[stuff->randrReqType]) (client);
-@@ -69,6 +71,7 @@
- {
- REQUEST(xRRSelectInputReq);
-
-+ REQUEST_SIZE_MATCH(xRRSelectInputReq);
- swaps(&stuff->length);
- swapl(&stuff->window);
- swaps(&stuff->enable);
-@@ -152,6 +155,7 @@
- {
- REQUEST(xRRConfigureOutputPropertyReq);
-
-+ REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq);
- swaps(&stuff->length);
- swapl(&stuff->output);
- swapl(&stuff->property);
-diff -Naur xorg-server-1.12.4.orig/render/render.c xorg-server-1.12.4/render/render.c
---- xorg-server-1.12.4.orig/render/render.c 2012-08-02 02:59:23.000000000 +0200
-+++ xorg-server-1.12.4/render/render.c 2014-11-28 09:51:16.878004670 +0100
-@@ -1994,7 +1994,7 @@
- SProcRenderQueryVersion(ClientPtr client)
- {
- REQUEST(xRenderQueryVersionReq);
--
-+ REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
- swaps(&stuff->length);
- swapl(&stuff->majorVersion);
- swapl(&stuff->minorVersion);
-@@ -2005,6 +2005,7 @@
- SProcRenderQueryPictFormats(ClientPtr client)
- {
- REQUEST(xRenderQueryPictFormatsReq);
-+ REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
- swaps(&stuff->length);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
- }
-@@ -2013,6 +2014,7 @@
- SProcRenderQueryPictIndexValues(ClientPtr client)
- {
- REQUEST(xRenderQueryPictIndexValuesReq);
-+ REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq);
- swaps(&stuff->length);
- swapl(&stuff->format);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-@@ -2028,6 +2030,7 @@
- SProcRenderCreatePicture(ClientPtr client)
- {
- REQUEST(xRenderCreatePictureReq);
-+ REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
- swaps(&stuff->length);
- swapl(&stuff->pid);
- swapl(&stuff->drawable);
-@@ -2041,6 +2044,7 @@
- SProcRenderChangePicture(ClientPtr client)
- {
- REQUEST(xRenderChangePictureReq);
-+ REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
- swaps(&stuff->length);
- swapl(&stuff->picture);
- swapl(&stuff->mask);
-@@ -2052,6 +2056,7 @@
- SProcRenderSetPictureClipRectangles(ClientPtr client)
- {
- REQUEST(xRenderSetPictureClipRectanglesReq);
-+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
- swaps(&stuff->length);
- swapl(&stuff->picture);
- swaps(&stuff->xOrigin);
-@@ -2064,6 +2069,7 @@
- SProcRenderFreePicture(ClientPtr client)
- {
- REQUEST(xRenderFreePictureReq);
-+ REQUEST_SIZE_MATCH(xRenderFreePictureReq);
- swaps(&stuff->length);
- swapl(&stuff->picture);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-@@ -2073,6 +2079,7 @@
- SProcRenderComposite(ClientPtr client)
- {
- REQUEST(xRenderCompositeReq);
-+ REQUEST_SIZE_MATCH(xRenderCompositeReq);
- swaps(&stuff->length);
- swapl(&stuff->src);
- swapl(&stuff->mask);
-@@ -2092,6 +2099,7 @@
- SProcRenderScale(ClientPtr client)
- {
- REQUEST(xRenderScaleReq);
-+ REQUEST_SIZE_MATCH(xRenderScaleReq);
- swaps(&stuff->length);
- swapl(&stuff->src);
- swapl(&stuff->dst);
-@@ -2192,6 +2200,7 @@
- SProcRenderCreateGlyphSet(ClientPtr client)
- {
- REQUEST(xRenderCreateGlyphSetReq);
-+ REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
- swaps(&stuff->length);
- swapl(&stuff->gsid);
- swapl(&stuff->format);
-@@ -2202,6 +2211,7 @@
- SProcRenderReferenceGlyphSet(ClientPtr client)
- {
- REQUEST(xRenderReferenceGlyphSetReq);
-+ REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
- swaps(&stuff->length);
- swapl(&stuff->gsid);
- swapl(&stuff->existing);
-@@ -2212,6 +2222,7 @@
- SProcRenderFreeGlyphSet(ClientPtr client)
- {
- REQUEST(xRenderFreeGlyphSetReq);
-+ REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
- swaps(&stuff->length);
- swapl(&stuff->glyphset);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-@@ -2226,6 +2237,7 @@
- xGlyphInfo *gi;
-
- REQUEST(xRenderAddGlyphsReq);
-+ REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
- swaps(&stuff->length);
- swapl(&stuff->glyphset);
- swapl(&stuff->nglyphs);
-@@ -2260,6 +2272,7 @@
- SProcRenderFreeGlyphs(ClientPtr client)
- {
- REQUEST(xRenderFreeGlyphsReq);
-+ REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
- swaps(&stuff->length);
- swapl(&stuff->glyphset);
- SwapRestL(stuff);
-@@ -2277,6 +2290,7 @@
- int size;
-
- REQUEST(xRenderCompositeGlyphsReq);
-+ REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
-
- switch (stuff->renderReqType) {
- default:
-diff -Naur xorg-server-1.12.4.orig/test/misc.c xorg-server-1.12.4/test/misc.c
---- xorg-server-1.12.4.orig/test/misc.c 2012-05-17 19:09:05.000000000 +0200
-+++ xorg-server-1.12.4/test/misc.c 2014-11-28 09:51:33.354188205 +0100
-@@ -28,6 +28,8 @@
- #include <stdint.h>
- #include "misc.h"
- #include "scrnintstr.h"
-+#include "dix.h"
-+#include "dixstruct.h"
-
- ScreenInfo screenInfo;
-
-@@ -155,11 +157,46 @@
- assert_dimensions(-w2, -h2, w2, h2);
- }
-
-+static int
-+dix_request_fixed_size_overflow(ClientRec *client)
-+{
-+ xReq req = { 0 };
-+
-+ client->req_len = req.length = 1;
-+ REQUEST_FIXED_SIZE(req, SIZE_MAX);
-+ return Success;
-+}
-+
-+static int
-+dix_request_fixed_size_match(ClientRec *client)
-+{
-+ xReq req = { 0 };
-+
-+ client->req_len = req.length = 9;
-+ REQUEST_FIXED_SIZE(req, 30);
-+ return Success;
-+}
-+
-+static void
-+dix_request_size_checks(void)
-+{
-+ ClientRec client = { 0 };
-+ int rc;
-+
-+ rc = dix_request_fixed_size_overflow(&client);
-+ assert(rc == BadLength);
-+
-+ rc = dix_request_fixed_size_match(&client);
-+ assert(rc == Success);
-+}
-+
-+
- int
- main(int argc, char **argv)
- {
- dix_version_compare();
- dix_update_desktop_dimensions();
-+ dix_request_size_checks();
-
- return 0;
- }
-diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xigetclientpointer.c xorg-server-1.12.4/test/xi2/protocol-xigetclientpointer.c
---- xorg-server-1.12.4.orig/test/xi2/protocol-xigetclientpointer.c 2012-05-17 19:09:05.000000000 +0200
-+++ xorg-server-1.12.4/test/xi2/protocol-xigetclientpointer.c 2014-11-28 09:51:28.970139371 +0100
-@@ -124,6 +124,11 @@
- request.win = INVALID_WINDOW_ID;
- request_XIGetClientPointer(&client_request, &request, BadWindow);
-
-+ printf("Testing invalid length\n");
-+ client_request.req_len -= 4;
-+ request_XIGetClientPointer(&client_request, &request, BadLength);
-+ client_request.req_len += 4;
-+
- test_data.cp_is_set = FALSE;
-
- printf("Testing window None, unset ClientPointer.\n");
-diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xipassivegrabdevice.c xorg-server-1.12.4/test/xi2/protocol-xipassivegrabdevice.c
---- xorg-server-1.12.4.orig/test/xi2/protocol-xipassivegrabdevice.c 2012-05-17 19:09:05.000000000 +0200
-+++ xorg-server-1.12.4/test/xi2/protocol-xipassivegrabdevice.c 2014-11-28 09:51:28.970139371 +0100
-@@ -137,6 +137,7 @@
- int rc;
- int modifiers;
-
-+ client_request.req_len = req->length;
- rc = ProcXIPassiveGrabDevice(&client_request);
- assert(rc == error);
-
-@@ -187,6 +188,13 @@
- request_XIPassiveGrabDevice(&client_request, request, BadDevice,
- request->deviceid);
-
-+ printf("Testing invalid length\n");
-+ request->length -= 2;
-+ request_XIPassiveGrabDevice(&client_request, request, BadLength,
-+ client_request.errorValue);
-+ /* re-init request since swapped length test leaves some values swapped */
-+ request_init(request, XIPassiveGrabDevice);
-+ request->grab_window = CLIENT_WINDOW_ID;
- request->deviceid = XIAllMasterDevices;
-
- printf("Testing invalid grab types\n");
-diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xiquerypointer.c xorg-server-1.12.4/test/xi2/protocol-xiquerypointer.c
---- xorg-server-1.12.4.orig/test/xi2/protocol-xiquerypointer.c 2012-05-17 19:09:05.000000000 +0200
-+++ xorg-server-1.12.4/test/xi2/protocol-xiquerypointer.c 2014-11-28 09:51:28.970139371 +0100
-@@ -200,6 +200,10 @@
- test_data.dev = devices.mouse;
- request.deviceid = devices.mouse->id;
- request_XIQueryPointer(&client_request, &request, Success);
-+
-+ /* test REQUEST_SIZE_MATCH */
-+ client_request.req_len -= 4;
-+ request_XIQueryPointer(&client_request, &request, BadLength);
- }
-
- int
-diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xiwarppointer.c xorg-server-1.12.4/test/xi2/protocol-xiwarppointer.c
---- xorg-server-1.12.4.orig/test/xi2/protocol-xiwarppointer.c 2012-05-17 19:09:05.000000000 +0200
-+++ xorg-server-1.12.4/test/xi2/protocol-xiwarppointer.c 2014-11-28 09:51:28.974139415 +0100
-@@ -197,6 +197,9 @@
- request_XIWarpPointer(&client_request, &request, Success);
-
- /* FIXME: src_x/y checks */
-+
-+ client_request.req_len -= 2; /* invalid length */
-+ request_XIWarpPointer(&client_request, &request, BadLength);
- }
-
- int
-diff -Naur xorg-server-1.12.4.orig/Xext/xcmisc.c xorg-server-1.12.4/Xext/xcmisc.c
---- xorg-server-1.12.4.orig/Xext/xcmisc.c 2012-05-17 19:09:01.000000000 +0200
-+++ xorg-server-1.12.4/Xext/xcmisc.c 2014-11-28 09:51:03.837859407 +0100
-@@ -161,6 +161,7 @@
- SProcXCMiscGetXIDList(ClientPtr client)
- {
- REQUEST(xXCMiscGetXIDListReq);
-+ REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
-
- swaps(&stuff->length);
- swapl(&stuff->count);
-diff -Naur xorg-server-1.12.4.orig/Xext/xvdisp.c xorg-server-1.12.4/Xext/xvdisp.c
---- xorg-server-1.12.4.orig/Xext/xvdisp.c 2012-05-17 19:09:01.000000000 +0200
-+++ xorg-server-1.12.4/Xext/xvdisp.c 2014-11-28 09:51:07.413899243 +0100
-@@ -1202,6 +1202,7 @@
- SProcXvQueryExtension(ClientPtr client)
- {
- REQUEST(xvQueryExtensionReq);
-+ REQUEST_SIZE_MATCH(xvQueryExtensionReq);
- swaps(&stuff->length);
- return XvProcVector[xv_QueryExtension] (client);
- }
-@@ -1210,6 +1211,7 @@
- SProcXvQueryAdaptors(ClientPtr client)
- {
- REQUEST(xvQueryAdaptorsReq);
-+ REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
- swaps(&stuff->length);
- swapl(&stuff->window);
- return XvProcVector[xv_QueryAdaptors] (client);
-@@ -1219,6 +1221,7 @@
- SProcXvQueryEncodings(ClientPtr client)
- {
- REQUEST(xvQueryEncodingsReq);
-+ REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- return XvProcVector[xv_QueryEncodings] (client);
-@@ -1228,6 +1231,7 @@
- SProcXvGrabPort(ClientPtr client)
- {
- REQUEST(xvGrabPortReq);
-+ REQUEST_SIZE_MATCH(xvGrabPortReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->time);
-@@ -1238,6 +1242,7 @@
- SProcXvUngrabPort(ClientPtr client)
- {
- REQUEST(xvUngrabPortReq);
-+ REQUEST_SIZE_MATCH(xvUngrabPortReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->time);
-@@ -1248,6 +1253,7 @@
- SProcXvPutVideo(ClientPtr client)
- {
- REQUEST(xvPutVideoReq);
-+ REQUEST_SIZE_MATCH(xvPutVideoReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->drawable);
-@@ -1267,6 +1273,7 @@
- SProcXvPutStill(ClientPtr client)
- {
- REQUEST(xvPutStillReq);
-+ REQUEST_SIZE_MATCH(xvPutStillReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->drawable);
-@@ -1286,6 +1293,7 @@
- SProcXvGetVideo(ClientPtr client)
- {
- REQUEST(xvGetVideoReq);
-+ REQUEST_SIZE_MATCH(xvGetVideoReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->drawable);
-@@ -1305,6 +1313,7 @@
- SProcXvGetStill(ClientPtr client)
- {
- REQUEST(xvGetStillReq);
-+ REQUEST_SIZE_MATCH(xvGetStillReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->drawable);
-@@ -1324,6 +1333,7 @@
- SProcXvPutImage(ClientPtr client)
- {
- REQUEST(xvPutImageReq);
-+ REQUEST_AT_LEAST_SIZE(xvPutImageReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->drawable);
-@@ -1347,6 +1357,7 @@
- SProcXvShmPutImage(ClientPtr client)
- {
- REQUEST(xvShmPutImageReq);
-+ REQUEST_SIZE_MATCH(xvShmPutImageReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->drawable);
-@@ -1374,6 +1385,7 @@
- SProcXvSelectVideoNotify(ClientPtr client)
- {
- REQUEST(xvSelectVideoNotifyReq);
-+ REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
- swaps(&stuff->length);
- swapl(&stuff->drawable);
- return XvProcVector[xv_SelectVideoNotify] (client);
-@@ -1383,6 +1395,7 @@
- SProcXvSelectPortNotify(ClientPtr client)
- {
- REQUEST(xvSelectPortNotifyReq);
-+ REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- return XvProcVector[xv_SelectPortNotify] (client);
-@@ -1392,6 +1405,7 @@
- SProcXvStopVideo(ClientPtr client)
- {
- REQUEST(xvStopVideoReq);
-+ REQUEST_SIZE_MATCH(xvStopVideoReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->drawable);
-@@ -1402,6 +1416,7 @@
- SProcXvSetPortAttribute(ClientPtr client)
- {
- REQUEST(xvSetPortAttributeReq);
-+ REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->attribute);
-@@ -1413,6 +1428,7 @@
- SProcXvGetPortAttribute(ClientPtr client)
- {
- REQUEST(xvGetPortAttributeReq);
-+ REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->attribute);
-@@ -1423,6 +1439,7 @@
- SProcXvQueryBestSize(ClientPtr client)
- {
- REQUEST(xvQueryBestSizeReq);
-+ REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swaps(&stuff->vid_w);
-@@ -1436,6 +1453,7 @@
- SProcXvQueryPortAttributes(ClientPtr client)
- {
- REQUEST(xvQueryPortAttributesReq);
-+ REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- return XvProcVector[xv_QueryPortAttributes] (client);
-@@ -1445,6 +1463,7 @@
- SProcXvQueryImageAttributes(ClientPtr client)
- {
- REQUEST(xvQueryImageAttributesReq);
-+ REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- swapl(&stuff->id);
-@@ -1457,6 +1476,7 @@
- SProcXvListImageFormats(ClientPtr client)
- {
- REQUEST(xvListImageFormatsReq);
-+ REQUEST_SIZE_MATCH(xvListImageFormatsReq);
- swaps(&stuff->length);
- swapl(&stuff->port);
- return XvProcVector[xv_ListImageFormats] (client);
-diff -Naur xorg-server-1.12.4.orig/xfixes/select.c xorg-server-1.12.4/xfixes/select.c
---- xorg-server-1.12.4.orig/xfixes/select.c 2012-05-17 19:09:05.000000000 +0200
-+++ xorg-server-1.12.4/xfixes/select.c 2014-11-28 09:51:22.470066963 +0100
-@@ -204,6 +204,7 @@
- {
- REQUEST(xXFixesSelectSelectionInputReq);
-
-+ REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
- swaps(&stuff->length);
- swapl(&stuff->window);
- swapl(&stuff->selection);
-diff -aur xorg-server-1.12.4.orig/render/render.c xorg-server-1.12.4/render/render.c
---- xorg-server-1.12.4.orig/render/render.c 2014-11-28 09:51:16.878004670 +0100
-+++ xorg-server-1.12.4/render/render.c 2014-11-28 10:00:10.899950898 +0100
-@@ -271,10 +271,11 @@
-
- REQUEST(xRenderQueryVersionReq);
-
-+ REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
-+
- pRenderClient->major_version = stuff->majorVersion;
- pRenderClient->minor_version = stuff->minorVersion;
-
-- REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
- memset(&rep, 0, sizeof(xRenderQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
-diff -Naur xorg-server-1.12.4.orig/glx/glxcmds.c xorg-server-1.12.4/glx/glxcmds.c
---- xorg-server-1.12.4.orig/glx/glxcmds.c 2014-11-28 10:01:44.068987817 +0100
-+++ xorg-server-1.12.4/glx/glxcmds.c 2014-11-28 10:05:07.515246883 +0100
-@@ -2032,6 +2032,8 @@
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
-+ REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq);
-+
- req = (xGLXRenderLargeReq *) pc;
- if (client->swapped) {
- __GLX_SWAP_SHORT(&req->length);
-@@ -2047,12 +2049,14 @@
- __glXResetLargeCommandStatus(cl);
- return error;
- }
-+ if (safe_pad(req->dataBytes) < 0)
-+ return BadLength;
- dataBytes = req->dataBytes;
-
- /*
- ** Check the request length.
- */
-- if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
-+ if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) {
- client->errorValue = req->length;
- /* Reset in case this isn't 1st request. */
- __glXResetLargeCommandStatus(cl);
-@@ -2062,7 +2066,7 @@
-
- if (cl->largeCmdRequestsSoFar == 0) {
- __GLXrenderSizeData entry;
-- int extra;
-+ int extra = 0;
- size_t cmdlen;
- int err;
-
-@@ -2075,13 +2079,17 @@
- return __glXError(GLXBadLargeRequest);
- }
-
-+ if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE)
-+ return BadLength;
-+
- hdr = (__GLXrenderLargeHeader *) pc;
- if (client->swapped) {
- __GLX_SWAP_INT(&hdr->length);
- __GLX_SWAP_INT(&hdr->opcode);
- }
-- cmdlen = hdr->length;
- opcode = hdr->opcode;
-+ if ((cmdlen = safe_pad(hdr->length)) < 0)
-+ return BadLength;
-
- /*
- ** Check for core opcodes and grab entry data.
-@@ -2103,17 +2111,13 @@
- if (extra < 0) {
- return BadLength;
- }
-- /* large command's header is 4 bytes longer, so add 4 */
-- if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) {
-- return BadLength;
-- }
- }
-- else {
-- /* constant size command */
-- if (cmdlen != __GLX_PAD(entry.bytes + 4)) {
-- return BadLength;
-- }
-+
-+ /* the +4 is safe because we know entry.bytes is small */
-+ if (cmdlen != safe_pad(safe_add(entry.bytes + 4, extra))) {
-+ return BadLength;
- }
-+
- /*
- ** Make enough space in the buffer, then copy the entire request.
- */
-@@ -2143,6 +2147,7 @@
- ** We are receiving subsequent (i.e. not the first) requests of a
- ** multi request command.
- */
-+ int bytesSoFar; /* including this packet */
-
- /*
- ** Check the request number and the total request count.
-@@ -2161,11 +2166,18 @@
- /*
- ** Check that we didn't get too much data.
- */
-- if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
-+ if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXError(GLXBadLargeRequest);
- }
-+
-+ if (bytesSoFar > cl->largeCmdBytesTotal) {
-+ client->errorValue = dataBytes;
-+ __glXResetLargeCommandStatus(cl);
-+ return __glXError(GLXBadLargeRequest);
-+ }
-+
- memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
- cl->largeCmdBytesSoFar += dataBytes;
- cl->largeCmdRequestsSoFar++;
-@@ -2186,8 +2198,7 @@
- ** the padding done below fixes a bug that did not allow
- ** large commands of odd sizes to be accepted by the server.
- */
-- if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
-- __GLX_PAD(cl->largeCmdBytesTotal)) {
-+ if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXError(GLXBadLargeRequest);
-diff -Naur xorg-server-1.12.4.orig/glx/indirect_texture_compression.c xorg-server-1.12.4/glx/indirect_texture_compression.c
---- xorg-server-1.12.4.orig/glx/indirect_texture_compression.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/indirect_texture_compression.c 2014-11-28 10:26:39.461548117 +0100
-@@ -47,6 +47,8 @@
- __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
- ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
-+
- pc += __GLX_SINGLE_HDR_SIZE;
- if (cx != NULL) {
- const GLenum target = *(GLenum *) (pc + 0);
-@@ -93,6 +95,8 @@
- __glXForceCurrent(cl, bswap_32(req->contextTag), &error);
- ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
-+
- pc += __GLX_SINGLE_HDR_SIZE;
- if (cx != NULL) {
- const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0));
-diff -Naur xorg-server-1.12.4.orig/glx/single2.c xorg-server-1.12.4/glx/single2.c
---- xorg-server-1.12.4.orig/glx/single2.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/single2.c 2014-11-28 10:26:39.461548117 +0100
-@@ -49,11 +49,14 @@
- int
- __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- GLsizei size;
- GLenum type;
- __GLXcontext *cx;
- int error;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -80,10 +83,13 @@
- int
- __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
- GLsizei size;
- int error;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -108,7 +114,7 @@
- int
- __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
- {
-- ClientPtr client;
-+ ClientPtr client = cl->client;
- xGLXRenderModeReply reply;
- __GLXcontext *cx;
- GLint nitems = 0, retBytes = 0, retval, newModeCheck;
-@@ -116,6 +122,8 @@
- GLenum newMode;
- int error;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -192,7 +200,6 @@
- ** selection array, as per the API for glRenderMode itself.
- */
- noChangeAllowed:;
-- client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-@@ -209,9 +216,12 @@
- int
- __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
- int error;
-
-+ REQUEST_SIZE_MATCH(xGLXSingleReq);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -225,10 +235,12 @@
- int
- __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
-- ClientPtr client;
- int error;
-
-+ REQUEST_SIZE_MATCH(xGLXSingleReq);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -319,7 +331,7 @@
- int
- DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
- {
-- ClientPtr client;
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
- GLenum name;
- const char *string;
-@@ -329,6 +341,8 @@
- char *buf = NULL, *buf1 = NULL;
- GLint length = 0;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
-+
- /* If the client has the opposite byte order, swap the contextTag and
- * the name.
- */
-@@ -345,7 +359,6 @@
- pc += __GLX_SINGLE_HDR_SIZE;
- name = *(GLenum *) (pc + 0);
- string = (const char *) CALL_GetString(GET_DISPATCH(), (name));
-- client = cl->client;
-
- if (string == NULL)
- string = "";
-diff -Naur xorg-server-1.12.4.orig/glx/single2swap.c xorg-server-1.12.4/glx/single2swap.c
---- xorg-server-1.12.4.orig/glx/single2swap.c 2012-05-17 19:09:02.000000000 +0200
-+++ xorg-server-1.12.4/glx/single2swap.c 2014-11-28 10:26:39.465548161 +0100
-@@ -45,6 +45,7 @@
- int
- __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- GLsizei size;
- GLenum type;
-
-@@ -52,6 +53,8 @@
- __GLXcontext *cx;
- int error;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -81,12 +84,15 @@
- int
- __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
- GLsizei size;
-
- __GLX_DECLARE_SWAP_VARIABLES;
- int error;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -113,7 +119,7 @@
- int
- __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
- {
-- ClientPtr client;
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
- xGLXRenderModeReply reply;
- GLint nitems = 0, retBytes = 0, retval, newModeCheck;
-@@ -124,6 +130,8 @@
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- int error;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -204,7 +212,6 @@
- ** selection array, as per the API for glRenderMode itself.
- */
- noChangeAllowed:;
-- client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-@@ -226,11 +233,14 @@
- int
- __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
- int error;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
-+ REQUEST_SIZE_MATCH(xGLXSingleReq);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -245,12 +255,14 @@
- int
- __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
- {
-+ ClientPtr client = cl->client;
- __GLXcontext *cx;
-- ClientPtr client;
- int error;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
-+ REQUEST_SIZE_MATCH(xGLXSingleReq);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -262,7 +274,6 @@
- cx->hasUnflushedCommands = GL_FALSE;
-
- /* Send empty reply packet to indicate finish is finished */
-- client = cl->client;
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_RETVAL(0);
- __GLX_SWAP_REPLY_HEADER();
-diff -Naur xorg-server-1.12.4.orig/glx/singlepix.c xorg-server-1.12.4/glx/singlepix.c
---- xorg-server-1.12.4.orig/glx/singlepix.c 2014-11-28 10:06:28.116140360 +0100
-+++ xorg-server-1.12.4/glx/singlepix.c 2014-11-28 10:26:39.465548161 +0100
-@@ -55,6 +55,8 @@
- int error;
- char *answer, answerBuffer[200];
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -107,6 +109,8 @@
- char *answer, answerBuffer[200];
- GLint width = 0, height = 0, depth = 1;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -169,6 +173,8 @@
- GLubyte answerBuffer[200];
- char *answer;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
-+
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
-@@ -231,15 +237,15 @@
- compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
- compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
-
-- if (compsize < 0)
-+ if ((compsize = safe_pad(compsize)) < 0)
- return BadLength;
-- if (compsize2 < 0)
-+
-+ if ((compsize2 = safe_pad(compsize2)) < 0)
- return BadLength;
-- compsize = __GLX_PAD(compsize);
-- compsize2 = __GLX_PAD(compsize2);
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes));
-- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize + compsize2, 1);
-+ __GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1);
-+
- __glXClearErrorOccured();
- CALL_GetSeparableFilter(GET_DISPATCH(), (*(GLenum *) (pc + 0),
- *(GLenum *) (pc + 4),
-@@ -265,7 +271,8 @@
- __glXDisp_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -273,7 +280,8 @@
- __glXDisp_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -343,7 +351,8 @@
- __glXDisp_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -351,7 +360,8 @@
- __glXDisp_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -411,7 +421,8 @@
- __glXDisp_GetHistogram(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -419,7 +430,8 @@
- __glXDisp_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -471,7 +483,8 @@
- __glXDisp_GetMinmax(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -479,7 +492,8 @@
- __glXDisp_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -540,7 +554,8 @@
- __glXDisp_GetColorTable(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -548,6 +563,7 @@
- __glXDisp_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
--
-+ ClientPtr client = cl->client;
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-diff -Naur xorg-server-1.12.4.orig/glx/singlepixswap.c xorg-server-1.12.4/glx/singlepixswap.c
---- xorg-server-1.12.4.orig/glx/singlepixswap.c 2014-11-28 10:06:28.116140360 +0100
-+++ xorg-server-1.12.4/glx/singlepixswap.c 2014-11-28 10:26:39.465548161 +0100
-@@ -57,6 +57,8 @@
- int error;
- char *answer, answerBuffer[200];
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -122,6 +124,8 @@
- char *answer, answerBuffer[200];
- GLint width = 0, height = 0, depth = 1;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -197,6 +201,8 @@
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
-+
- __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
-@@ -266,15 +272,13 @@
- compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
- compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
-
-- if (compsize < 0)
-+ if ((compsize = safe_pad(compsize)) < 0)
- return BadLength;
-- if (compsize2 < 0)
-+ if ((compsize2 = safe_pad(compsize2)) < 0)
- return BadLength;
-- compsize = __GLX_PAD(compsize);
-- compsize2 = __GLX_PAD(compsize2);
-
- CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes));
-- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize + compsize2, 1);
-+ __GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1);
- __glXClearErrorOccured();
- CALL_GetSeparableFilter(GET_DISPATCH(), (*(GLenum *) (pc + 0),
- *(GLenum *) (pc + 4),
-@@ -302,7 +306,9 @@
- __glXDispSwap_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -310,7 +316,9 @@
- __glXDispSwap_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -388,7 +396,9 @@
- __glXDispSwap_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -396,7 +406,9 @@
- __glXDispSwap_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -463,7 +475,9 @@
- __glXDispSwap_GetHistogram(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -471,7 +485,9 @@
- __glXDispSwap_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -529,7 +545,9 @@
- __glXDispSwap_GetMinmax(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -537,7 +555,9 @@
- __glXDispSwap_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-
-@@ -605,7 +625,9 @@
- __glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
- return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
- }
-
-@@ -613,6 +635,8 @@
- __glXDispSwap_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc)
- {
- const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
-+ ClientPtr client = cl->client;
-
-+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
- return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
- }
-diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
-index ff5d69a..e87df42 100644
---- a/Xi/chgdctl.c
-+++ b/Xi/chgdctl.c
-@@ -78,7 +78,7 @@ SProcXChangeDeviceControl(ClientPtr client)
-
- REQUEST(xChangeDeviceControlReq);
- swaps(&stuff->length);
-- REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
-+ REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
- swaps(&stuff->control);
- ctl = (xDeviceCtl *) &stuff[1];
- swaps(&ctl->control);
-@@ -116,7 +116,7 @@ ProcXChangeDeviceControl(ClientPtr client)
- devicePresenceNotify dpn;
-
- REQUEST(xChangeDeviceControlReq);
-- REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
-+ REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
-
- len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceControlReq));
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
-@@ -184,6 +184,10 @@ ProcXChangeDeviceControl(ClientPtr client)
- break;
- case DEVICE_ENABLE:
- e = (xDeviceEnableCtl *) &stuff[1];
-+ if ((len != bytes_to_int32(sizeof(xDeviceEnableCtl)))) {
-+ ret = BadLength;
-+ goto out;
-+ }
-
- status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e);
-
-diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
-index 6dcf60c..224c2ba 100644
---- a/Xi/chgfctl.c
-+++ b/Xi/chgfctl.c
-@@ -467,6 +467,8 @@ ProcXChangeFeedbackControl(ClientPtr client)
- xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
-
- if (client->swapped) {
-+ if (len < bytes_to_int32(sizeof(xStringFeedbackCtl)))
-+ return BadLength;
- swaps(&f->num_keysyms);
- }
- if (len !=
-diff --git a/Xi/sendexev.c b/Xi/sendexev.c
-index 3c21386..183f88d 100644
---- a/Xi/sendexev.c
-+++ b/Xi/sendexev.c
-@@ -135,6 +135,9 @@ ProcXSendExtensionEvent(ClientPtr client)
- if (ret != Success)
- return ret;
-
-+ if (stuff->num_events == 0)
-+ return ret;
-+
- /* The client's event type must be one defined by an extension. */
-
- first = ((xEvent *) &stuff[1]);
-diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
-index 62a0727..156c738 100644
---- a/Xi/xiallowev.c
-+++ b/Xi/xiallowev.c
-@@ -48,6 +48,7 @@ int
- SProcXIAllowEvents(ClientPtr client)
- {
- REQUEST(xXIAllowEventsReq);
-+ REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
-@@ -55,6 +56,7 @@ SProcXIAllowEvents(ClientPtr client)
- if (stuff->length > 3) {
- xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
-
-+ REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
- swapl(&req_xi22->touchid);
- swapl(&req_xi22->grab_window);
- }
-diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c
-index 0be6bc0..33e9e9c 100644
---- a/Xi/xichangecursor.c
-+++ b/Xi/xichangecursor.c
-@@ -57,11 +57,11 @@ int
- SProcXIChangeCursor(ClientPtr client)
- {
- REQUEST(xXIChangeCursorReq);
-+ REQUEST_SIZE_MATCH(xXIChangeCursorReq);
- swaps(&stuff->length);
- swapl(&stuff->win);
- swapl(&stuff->cursor);
- swaps(&stuff->deviceid);
-- REQUEST_SIZE_MATCH(xXIChangeCursorReq);
- return (ProcXIChangeCursor(client));
- }
-
-diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
-index 756aaac..d2244cf 100644
---- a/Xi/xichangehierarchy.c
-+++ b/Xi/xichangehierarchy.c
-@@ -407,7 +407,7 @@ int
- ProcXIChangeHierarchy(ClientPtr client)
- {
- xXIAnyHierarchyChangeInfo *any;
-- int required_len = sizeof(xXIChangeHierarchyReq);
-+ size_t len; /* length of data remaining in request */
- int rc = Success;
- int flags[MAXDEVICES] = { 0 };
-
-@@ -417,21 +417,46 @@ ProcXIChangeHierarchy(ClientPtr client)
- if (!stuff->num_changes)
- return rc;
-
-+ if (stuff->length > (INT_MAX >> 2))
-+ return BadAlloc;
-+ len = (stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo);
-+
- any = (xXIAnyHierarchyChangeInfo *) &stuff[1];
- while (stuff->num_changes--) {
-+ if (len < sizeof(xXIAnyHierarchyChangeInfo)) {
-+ rc = BadLength;
-+ goto unwind;
-+ }
-+
- SWAPIF(swaps(&any->type));
- SWAPIF(swaps(&any->length));
-
-- required_len += any->length;
-- if ((stuff->length * 4) < required_len)
-+ if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
- return BadLength;
-
-+#define CHANGE_SIZE_MATCH(type) \
-+ do { \
-+ if ((len < sizeof(type)) || (any->length != (sizeof(type) >> 2))) { \
-+ rc = BadLength; \
-+ goto unwind; \
-+ } \
-+ } while(0)
-+
- switch (any->type) {
- case XIAddMaster:
- {
- xXIAddMasterInfo *c = (xXIAddMasterInfo *) any;
-
-+ /* Variable length, due to appended name string */
-+ if (len < sizeof(xXIAddMasterInfo)) {
-+ rc = BadLength;
-+ goto unwind;
-+ }
- SWAPIF(swaps(&c->name_len));
-+ if (c->name_len > (len - sizeof(xXIAddMasterInfo))) {
-+ rc = BadLength;
-+ goto unwind;
-+ }
-
- rc = add_master(client, c, flags);
- if (rc != Success)
-@@ -442,6 +467,7 @@ ProcXIChangeHierarchy(ClientPtr client)
- {
- xXIRemoveMasterInfo *r = (xXIRemoveMasterInfo *) any;
-
-+ CHANGE_SIZE_MATCH(xXIRemoveMasterInfo);
- rc = remove_master(client, r, flags);
- if (rc != Success)
- goto unwind;
-@@ -451,6 +477,7 @@ ProcXIChangeHierarchy(ClientPtr client)
- {
- xXIDetachSlaveInfo *c = (xXIDetachSlaveInfo *) any;
-
-+ CHANGE_SIZE_MATCH(xXIDetachSlaveInfo);
- rc = detach_slave(client, c, flags);
- if (rc != Success)
- goto unwind;
-@@ -460,6 +487,7 @@ ProcXIChangeHierarchy(ClientPtr client)
- {
- xXIAttachSlaveInfo *c = (xXIAttachSlaveInfo *) any;
-
-+ CHANGE_SIZE_MATCH(xXIAttachSlaveInfo);
- rc = attach_slave(client, c, flags);
- if (rc != Success)
- goto unwind;
-@@ -467,6 +495,7 @@ ProcXIChangeHierarchy(ClientPtr client)
- break;
- }
-
-+ len -= any->length * 4;
- any = (xXIAnyHierarchyChangeInfo *) ((char *) any + any->length * 4);
- }
-
-diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c
-index 07dbf18..a066497 100644
---- a/Xi/xigetclientpointer.c
-+++ b/Xi/xigetclientpointer.c
-@@ -50,6 +50,7 @@ int
- SProcXIGetClientPointer(ClientPtr client)
- {
- REQUEST(xXIGetClientPointerReq);
-+ REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
-
- swaps(&stuff->length);
- swapl(&stuff->win);
-diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c
-index 8d2cf0b..3dafbbd 100644
---- a/Xi/xigrabdev.c
-+++ b/Xi/xigrabdev.c
-@@ -47,6 +47,11 @@ int
- SProcXIGrabDevice(ClientPtr client)
- {
- REQUEST(xXIGrabDeviceReq);
-+ /*
-+ * Check here for at least the length of the struct we swap, then
-+ * let ProcXIGrabDevice check the full size after we swap mask_len.
-+ */
-+ REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
-@@ -69,7 +74,7 @@ ProcXIGrabDevice(ClientPtr client)
- int mask_len;
-
- REQUEST(xXIGrabDeviceReq);
-- REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
-+ REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4);
-
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
- if (ret != Success)
-@@ -118,6 +123,7 @@ int
- SProcXIUngrabDevice(ClientPtr client)
- {
- REQUEST(xXIUngrabDeviceReq);
-+ REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
-@@ -135,6 +141,7 @@ ProcXIUngrabDevice(ClientPtr client)
- TimeStamp time;
-
- REQUEST(xXIUngrabDeviceReq);
-+ REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
-
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
- if (ret != Success)
-diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
-index 7130328..06f44d7 100644
---- a/Xi/xipassivegrab.c
-+++ b/Xi/xipassivegrab.c
-@@ -53,6 +53,7 @@ SProcXIPassiveGrabDevice(ClientPtr client)
- xXIModifierInfo *mods;
-
- REQUEST(xXIPassiveGrabDeviceReq);
-+ REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
-@@ -63,7 +64,9 @@ SProcXIPassiveGrabDevice(ClientPtr client)
- swaps(&stuff->mask_len);
- swaps(&stuff->num_modifiers);
-
-- mods = (xXIModifierInfo *) &stuff[1];
-+ REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
-+ ((uint32_t) stuff->mask_len + stuff->num_modifiers) *4);
-+ mods = (uint32_t *) &stuff[1] + stuff->mask_len;
-
- for (i = 0; i < stuff->num_modifiers; i++, mods++) {
- swapl(&mods->base_mods);
-@@ -88,7 +91,8 @@ ProcXIPassiveGrabDevice(ClientPtr client)
- int mask_len;
-
- REQUEST(xXIPassiveGrabDeviceReq);
-- REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
-+ REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
-+ ((uint32_t) stuff->mask_len + stuff->num_modifiers) * 4);
-
- if (stuff->deviceid == XIAllDevices)
- dev = inputInfo.all_devices;
-@@ -250,6 +254,7 @@ SProcXIPassiveUngrabDevice(ClientPtr client)
- uint32_t *modifiers;
-
- REQUEST(xXIPassiveUngrabDeviceReq);
-+ REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
-
- swaps(&stuff->length);
- swapl(&stuff->grab_window);
-@@ -257,6 +262,8 @@ SProcXIPassiveUngrabDevice(ClientPtr client)
- swapl(&stuff->detail);
- swaps(&stuff->num_modifiers);
-
-+ REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
-+ ((uint32_t) stuff->num_modifiers) << 2);
- modifiers = (uint32_t *) &stuff[1];
-
- for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
-@@ -275,7 +282,8 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
- int i, rc;
-
- REQUEST(xXIPassiveUngrabDeviceReq);
-- REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
-+ REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
-+ ((uint32_t) stuff->num_modifiers) << 2);
-
- if (stuff->deviceid == XIAllDevices)
- dev = inputInfo.all_devices;
-diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
-index e51aadb..37dc0c6 100644
---- a/Xi/xiproperty.c
-+++ b/Xi/xiproperty.c
-@@ -1007,10 +1007,9 @@ int
- SProcXListDeviceProperties(ClientPtr client)
- {
- REQUEST(xListDevicePropertiesReq);
-+ REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
-
- swaps(&stuff->length);
--
-- REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
- return (ProcXListDeviceProperties(client));
- }
-
-@@ -1031,10 +1030,10 @@ int
- SProcXDeleteDeviceProperty(ClientPtr client)
- {
- REQUEST(xDeleteDevicePropertyReq);
-+ REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
-
- swaps(&stuff->length);
- swapl(&stuff->property);
-- REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
- return (ProcXDeleteDeviceProperty(client));
- }
-
-@@ -1042,13 +1041,13 @@ int
- SProcXGetDeviceProperty(ClientPtr client)
- {
- REQUEST(xGetDevicePropertyReq);
-+ REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
-
- swaps(&stuff->length);
- swapl(&stuff->property);
- swapl(&stuff->type);
- swapl(&stuff->longOffset);
- swapl(&stuff->longLength);
-- REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
- return (ProcXGetDeviceProperty(client));
- }
-
-@@ -1243,11 +1242,10 @@ int
- SProcXIListProperties(ClientPtr client)
- {
- REQUEST(xXIListPropertiesReq);
-+ REQUEST_SIZE_MATCH(xXIListPropertiesReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
--
-- REQUEST_SIZE_MATCH(xXIListPropertiesReq);
- return (ProcXIListProperties(client));
- }
-
-@@ -1269,11 +1267,11 @@ int
- SProcXIDeleteProperty(ClientPtr client)
- {
- REQUEST(xXIDeletePropertyReq);
-+ REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
- swapl(&stuff->property);
-- REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
- return (ProcXIDeleteProperty(client));
- }
-
-@@ -1281,6 +1279,7 @@ int
- SProcXIGetProperty(ClientPtr client)
- {
- REQUEST(xXIGetPropertyReq);
-+ REQUEST_SIZE_MATCH(xXIGetPropertyReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
-@@ -1288,7 +1287,6 @@ SProcXIGetProperty(ClientPtr client)
- swapl(&stuff->type);
- swapl(&stuff->offset);
- swapl(&stuff->len);
-- REQUEST_SIZE_MATCH(xXIGetPropertyReq);
- return (ProcXIGetProperty(client));
- }
-
-diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
-index 15c8b2a..5e5c875 100644
---- a/Xi/xiquerydevice.c
-+++ b/Xi/xiquerydevice.c
-@@ -54,6 +54,7 @@ int
- SProcXIQueryDevice(ClientPtr client)
- {
- REQUEST(xXIQueryDeviceReq);
-+ REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
-
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
-diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
-index 169436e..e61fa04 100644
---- a/Xi/xiquerypointer.c
-+++ b/Xi/xiquerypointer.c
-@@ -62,6 +62,8 @@ int
- SProcXIQueryPointer(ClientPtr client)
- {
- REQUEST(xXIQueryPointerReq);
-+ REQUEST_SIZE_MATCH(xXIQueryPointerReq);
-+
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
- swapl(&stuff->win);
-diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
-index 07d3218..fc02034 100644
---- a/Xi/xiselectev.c
-+++ b/Xi/xiselectev.c
-@@ -63,6 +63,7 @@ int
- SProcXISelectEvents(ClientPtr client)
- {
- int i;
-+ int len;
- xXIEventMask *evmask;
-
- REQUEST(xXISelectEventsReq);
-@@ -71,10 +72,17 @@ SProcXISelectEvents(ClientPtr client)
- swapl(&stuff->win);
- swaps(&stuff->num_masks);
-
-+ len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq));
- evmask = (xXIEventMask *) &stuff[1];
- for (i = 0; i < stuff->num_masks; i++) {
-+ if (len < bytes_to_int32(sizeof(xXIEventMask)))
-+ return BadLength;
-+ len -= bytes_to_int32(sizeof(xXIEventMask));
- swaps(&evmask->deviceid);
- swaps(&evmask->mask_len);
-+ if (len < evmask->mask_len)
-+ return BadLength;
-+ len -= evmask->mask_len;
- evmask =
- (xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4);
- }
-diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c
-index 38ff51e..24d4a53 100644
---- a/Xi/xisetclientpointer.c
-+++ b/Xi/xisetclientpointer.c
-@@ -51,10 +51,11 @@ int
- SProcXISetClientPointer(ClientPtr client)
- {
- REQUEST(xXISetClientPointerReq);
-+ REQUEST_SIZE_MATCH(xXISetClientPointerReq);
-+
- swaps(&stuff->length);
- swapl(&stuff->win);
- swaps(&stuff->deviceid);
-- REQUEST_SIZE_MATCH(xXISetClientPointerReq);
- return (ProcXISetClientPointer(client));
- }
-
-diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c
-index b52c9cc..a32ccb1 100644
---- a/Xi/xisetdevfocus.c
-+++ b/Xi/xisetdevfocus.c
-@@ -44,6 +44,8 @@ int
- SProcXISetFocus(ClientPtr client)
- {
- REQUEST(xXISetFocusReq);
-+ REQUEST_AT_LEAST_SIZE(xXISetFocusReq);
-+
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
- swapl(&stuff->focus);
-@@ -56,6 +58,8 @@ int
- SProcXIGetFocus(ClientPtr client)
- {
- REQUEST(xXIGetFocusReq);
-+ REQUEST_AT_LEAST_SIZE(xXIGetFocusReq);
-+
- swaps(&stuff->length);
- swaps(&stuff->deviceid);
-
-diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c
-index 3f051f7..780758a 100644
---- a/Xi/xiwarppointer.c
-+++ b/Xi/xiwarppointer.c
-@@ -56,6 +56,8 @@ int
- SProcXIWarpPointer(ClientPtr client)
- {
- REQUEST(xXIWarpPointerReq);
-+ REQUEST_SIZE_MATCH(xXIWarpPointerReq);
-+
- swaps(&stuff->length);
- swapl(&stuff->src_win);
- swapl(&stuff->dst_win);
-diff --git a/glx/glxcmds.c b/glx/glxcmds.c
-index badc2cf..1479634 100644
---- a/glx/glxcmds.c
-+++ b/glx/glxcmds.c
-@@ -1990,7 +1990,8 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc)
- if (entry.varsize) {
- /* variable size command */
- extra = (*entry.varsize) (pc + __GLX_RENDER_HDR_SIZE,
-- client->swapped);
-+ client->swapped,
-+ left - __GLX_RENDER_HDR_SIZE);
- if (extra < 0) {
- return BadLength;
- }
-@@ -2067,6 +2068,7 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
- if (cl->largeCmdRequestsSoFar == 0) {
- __GLXrenderSizeData entry;
- int extra = 0;
-+ int left = (req->length << 2) - sz_xGLXRenderLargeReq;
- size_t cmdlen;
- int err;
-
-@@ -2107,7 +2109,8 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
- ** will be in the 1st request, so it's okay to do this.
- */
- extra = (*entry.varsize) (pc + __GLX_RENDER_LARGE_HDR_SIZE,
-- client->swapped);
-+ client->swapped,
-+ left - __GLX_RENDER_LARGE_HDR_SIZE);
- if (extra < 0) {
- return BadLength;
- }
-diff --git a/glx/glxserver.h b/glx/glxserver.h
-index 9bffcd8..ccb895e 100644
---- a/glx/glxserver.h
-+++ b/glx/glxserver.h
-@@ -167,7 +167,7 @@ typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc);
- /*
- * Tables for computing the size of each rendering command.
- */
--typedef int (*gl_proto_size_func) (const GLbyte *, Bool);
-+typedef int (*gl_proto_size_func) (const GLbyte *, Bool, int);
-
- typedef struct {
- int bytes;
-diff --git a/glx/indirect_reqsize.c b/glx/indirect_reqsize.c
-index 86ea970..ce58214 100644
---- a/glx/indirect_reqsize.c
-+++ b/glx/indirect_reqsize.c
-@@ -31,24 +31,22 @@
- #include "indirect_size.h"
- #include "indirect_reqsize.h"
-
--#define __GLX_PAD(x) (((x) + 3) & ~3)
--
- #if defined(__CYGWIN__) || defined(__MINGW32__)
- #undef HAVE_ALIAS
- #endif
- #ifdef HAVE_ALIAS
- #define ALIAS2(from,to) \
-- GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
-+ GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \
- __attribute__ ((alias( # to )));
- #define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )
- #else
- #define ALIAS(from,to) \
-- GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
-- { return __glX ## to ## ReqSize( pc, swap ); }
-+ GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \
-+ { return __glX ## to ## ReqSize( pc, swap, reqlen ); }
- #endif
-
- int
--__glXCallListsReqSize(const GLbyte * pc, Bool swap)
-+__glXCallListsReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 0);
- GLenum type = *(GLenum *) (pc + 4);
-@@ -60,11 +58,11 @@ __glXCallListsReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glCallLists_size(type);
-- return __GLX_PAD((compsize * n));
-+ return safe_pad(safe_mul(compsize, n));
- }
-
- int
--__glXBitmapReqSize(const GLbyte * pc, Bool swap)
-+__glXBitmapReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -88,7 +86,7 @@ __glXBitmapReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXFogfvReqSize(const GLbyte * pc, Bool swap)
-+__glXFogfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 0);
- GLsizei compsize;
-@@ -98,11 +96,11 @@ __glXFogfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glFogfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXLightfvReqSize(const GLbyte * pc, Bool swap)
-+__glXLightfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -112,11 +110,11 @@ __glXLightfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glLightfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXLightModelfvReqSize(const GLbyte * pc, Bool swap)
-+__glXLightModelfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 0);
- GLsizei compsize;
-@@ -126,11 +124,11 @@ __glXLightModelfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glLightModelfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXMaterialfvReqSize(const GLbyte * pc, Bool swap)
-+__glXMaterialfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -140,11 +138,11 @@ __glXMaterialfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glMaterialfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXPolygonStippleReqSize(const GLbyte * pc, Bool swap)
-+__glXPolygonStippleReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -164,7 +162,7 @@ __glXPolygonStippleReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXTexParameterfvReqSize(const GLbyte * pc, Bool swap)
-+__glXTexParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -174,11 +172,11 @@ __glXTexParameterfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glTexParameterfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXTexImage1DReqSize(const GLbyte * pc, Bool swap)
-+__glXTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -206,7 +204,7 @@ __glXTexImage1DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXTexImage2DReqSize(const GLbyte * pc, Bool swap)
-+__glXTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -236,7 +234,7 @@ __glXTexImage2DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXTexEnvfvReqSize(const GLbyte * pc, Bool swap)
-+__glXTexEnvfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -246,11 +244,11 @@ __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glTexEnvfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXTexGendvReqSize(const GLbyte * pc, Bool swap)
-+__glXTexGendvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -260,11 +258,11 @@ __glXTexGendvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glTexGendv_size(pname);
-- return __GLX_PAD((compsize * 8));
-+ return safe_pad(safe_mul(compsize, 8));
- }
-
- int
--__glXTexGenfvReqSize(const GLbyte * pc, Bool swap)
-+__glXTexGenfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -274,11 +272,11 @@ __glXTexGenfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glTexGenfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXPixelMapfvReqSize(const GLbyte * pc, Bool swap)
-+__glXPixelMapfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei mapsize = *(GLsizei *) (pc + 4);
-
-@@ -286,11 +284,11 @@ __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap)
- mapsize = bswap_32(mapsize);
- }
-
-- return __GLX_PAD((mapsize * 4));
-+ return safe_pad(safe_mul(mapsize, 4));
- }
-
- int
--__glXPixelMapusvReqSize(const GLbyte * pc, Bool swap)
-+__glXPixelMapusvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei mapsize = *(GLsizei *) (pc + 4);
-
-@@ -298,11 +296,11 @@ __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap)
- mapsize = bswap_32(mapsize);
- }
-
-- return __GLX_PAD((mapsize * 2));
-+ return safe_pad(safe_mul(mapsize, 2));
- }
-
- int
--__glXDrawPixelsReqSize(const GLbyte * pc, Bool swap)
-+__glXDrawPixelsReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -330,7 +328,7 @@ __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap)
-+__glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 0);
-
-@@ -338,11 +336,11 @@ __glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 4) + (n * 4));
-+ return safe_pad(safe_add(safe_mul(n, 4), safe_mul(n, 4)));
- }
-
- int
--__glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap)
-+__glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -370,7 +368,7 @@ __glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap)
-+__glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -400,7 +398,7 @@ __glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXColorTableReqSize(const GLbyte * pc, Bool swap)
-+__glXColorTableReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -428,7 +426,7 @@ __glXColorTableReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap)
-+__glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -438,11 +436,11 @@ __glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glColorTableParameterfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXColorSubTableReqSize(const GLbyte * pc, Bool swap)
-+__glXColorSubTableReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -470,7 +468,7 @@ __glXColorSubTableReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap)
-+__glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -498,7 +496,7 @@ __glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap)
-+__glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = 0;
-@@ -528,7 +526,7 @@ __glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap)
-+__glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 4);
- GLsizei compsize;
-@@ -538,11 +536,11 @@ __glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glConvolutionParameterfv_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXTexImage3DReqSize(const GLbyte * pc, Bool swap)
-+__glXTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = *(GLint *) (pc + 8);
-@@ -579,7 +577,7 @@ __glXTexImage3DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap)
-+__glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLint row_length = *(GLint *) (pc + 4);
- GLint image_height = *(GLint *) (pc + 8);
-@@ -613,7 +611,7 @@ __glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXCompressedTexImage1DARBReqSize(const GLbyte * pc, Bool swap)
-+__glXCompressedTexImage1DARBReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei imageSize = *(GLsizei *) (pc + 20);
-
-@@ -621,11 +619,11 @@ __glXCompressedTexImage1DARBReqSize(const GLbyte * pc, Bool swap)
- imageSize = bswap_32(imageSize);
- }
-
-- return __GLX_PAD(imageSize);
-+ return safe_pad(imageSize);
- }
-
- int
--__glXCompressedTexImage2DARBReqSize(const GLbyte * pc, Bool swap)
-+__glXCompressedTexImage2DARBReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei imageSize = *(GLsizei *) (pc + 24);
-
-@@ -633,11 +631,11 @@ __glXCompressedTexImage2DARBReqSize(const GLbyte * pc, Bool swap)
- imageSize = bswap_32(imageSize);
- }
-
-- return __GLX_PAD(imageSize);
-+ return safe_pad(imageSize);
- }
-
- int
--__glXCompressedTexImage3DARBReqSize(const GLbyte * pc, Bool swap)
-+__glXCompressedTexImage3DARBReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei imageSize = *(GLsizei *) (pc + 28);
-
-@@ -645,11 +643,11 @@ __glXCompressedTexImage3DARBReqSize(const GLbyte * pc, Bool swap)
- imageSize = bswap_32(imageSize);
- }
-
-- return __GLX_PAD(imageSize);
-+ return safe_pad(imageSize);
- }
-
- int
--__glXCompressedTexSubImage3DARBReqSize(const GLbyte * pc, Bool swap)
-+__glXCompressedTexSubImage3DARBReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei imageSize = *(GLsizei *) (pc + 36);
-
-@@ -657,11 +655,11 @@ __glXCompressedTexSubImage3DARBReqSize(const GLbyte * pc, Bool swap)
- imageSize = bswap_32(imageSize);
- }
-
-- return __GLX_PAD(imageSize);
-+ return safe_pad(imageSize);
- }
-
- int
--__glXProgramStringARBReqSize(const GLbyte * pc, Bool swap)
-+__glXProgramStringARBReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei len = *(GLsizei *) (pc + 8);
-
-@@ -669,11 +667,11 @@ __glXProgramStringARBReqSize(const GLbyte * pc, Bool swap)
- len = bswap_32(len);
- }
-
-- return __GLX_PAD(len);
-+ return safe_pad(len);
- }
-
- int
--__glXDrawBuffersARBReqSize(const GLbyte * pc, Bool swap)
-+__glXDrawBuffersARBReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 0);
-
-@@ -681,11 +679,11 @@ __glXDrawBuffersARBReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 4));
-+ return safe_pad(safe_mul(n, 4));
- }
-
- int
--__glXPointParameterfvEXTReqSize(const GLbyte * pc, Bool swap)
-+__glXPointParameterfvEXTReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum pname = *(GLenum *) (pc + 0);
- GLsizei compsize;
-@@ -695,11 +693,11 @@ __glXPointParameterfvEXTReqSize(const GLbyte * pc, Bool swap)
- }
-
- compsize = __glPointParameterfvEXT_size(pname);
-- return __GLX_PAD((compsize * 4));
-+ return safe_pad(safe_mul(compsize, 4));
- }
-
- int
--__glXProgramParameters4dvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXProgramParameters4dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei num = *(GLsizei *) (pc + 8);
-
-@@ -707,11 +705,11 @@ __glXProgramParameters4dvNVReqSize(const GLbyte * pc, Bool swap)
- num = bswap_32(num);
- }
-
-- return __GLX_PAD((num * 32));
-+ return safe_pad(safe_mul(num, 32));
- }
-
- int
--__glXProgramParameters4fvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXProgramParameters4fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei num = *(GLsizei *) (pc + 8);
-
-@@ -719,11 +717,11 @@ __glXProgramParameters4fvNVReqSize(const GLbyte * pc, Bool swap)
- num = bswap_32(num);
- }
-
-- return __GLX_PAD((num * 16));
-+ return safe_pad(safe_mul(num, 16));
- }
-
- int
--__glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 4);
-
-@@ -731,11 +729,11 @@ __glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 8));
-+ return safe_pad(safe_mul(n, 8));
- }
-
- int
--__glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 4);
-
-@@ -743,11 +741,11 @@ __glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 16));
-+ return safe_pad(safe_mul(n, 16));
- }
-
- int
--__glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 4);
-
-@@ -755,11 +753,11 @@ __glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 24));
-+ return safe_pad(safe_mul(n, 24));
- }
-
- int
--__glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 4);
-
-@@ -767,11 +765,11 @@ __glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 12));
-+ return safe_pad(safe_mul(n, 12));
- }
-
- int
--__glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap)
-+__glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 4);
-
-@@ -779,11 +777,11 @@ __glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 6));
-+ return safe_pad(safe_mul(n, 6));
- }
-
- int
--__glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei n = *(GLsizei *) (pc + 4);
-
-@@ -791,11 +789,11 @@ __glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap)
- n = bswap_32(n);
- }
-
-- return __GLX_PAD((n * 32));
-+ return safe_pad(safe_mul(n, 32));
- }
-
- int
--__glXProgramNamedParameter4fvNVReqSize(const GLbyte * pc, Bool swap)
-+__glXProgramNamedParameter4fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLsizei len = *(GLsizei *) (pc + 4);
-
-@@ -803,7 +801,7 @@ __glXProgramNamedParameter4fvNVReqSize(const GLbyte * pc, Bool swap)
- len = bswap_32(len);
- }
-
-- return __GLX_PAD(len);
-+ return safe_pad(len);
- }
-
- ALIAS(Fogiv, Fogfv)
-diff --git a/glx/indirect_reqsize.h b/glx/indirect_reqsize.h
-index d2c1da7..22e1350 100644
---- a/glx/indirect_reqsize.h
-+++ b/glx/indirect_reqsize.h
-@@ -36,128 +36,128 @@
- #define PURE
- #endif
-
--extern PURE _X_HIDDEN int __glXCallListsReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXBitmapReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXFogfvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXFogivReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXLightfvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXLightivReqSize(const GLbyte * pc, Bool swap);
-+extern PURE _X_HIDDEN int __glXCallListsReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXBitmapReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXFogfvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXFogivReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXLightfvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXLightivReqSize(const GLbyte * pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXLightModelfvReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXLightModelivReqSize(const GLbyte * pc,
-- Bool swap);
--extern PURE _X_HIDDEN int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXMaterialivReqSize(const GLbyte * pc, Bool swap);
-+ Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXMaterialivReqSize(const GLbyte * pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXPolygonStippleReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXTexParameterfvReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXTexParameterivReqSize(const GLbyte * pc,
-- Bool swap);
--extern PURE _X_HIDDEN int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXTexEnvivReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXTexGendvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXTexGenivReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXMap1dReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXMap1fReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXMap2dReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXMap2fReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXPixelMapuivReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap);
--extern PURE _X_HIDDEN int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap);
-+ Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexEnvivReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexGendvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexGenivReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXMap1dReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXMap1fReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXMap2dReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXPixelMapuivReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXTexSubImage1DReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXTexSubImage2DReqSize(const GLbyte * pc,
-- Bool swap);
--extern PURE _X_HIDDEN int __glXColorTableReqSize(const GLbyte * pc, Bool swap);
-+ Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXColorTableReqSize(const GLbyte * pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXColorTableParameterivReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXColorSubTableReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte * pc,
-- Bool swap);
--extern PURE _X_HIDDEN int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap);
-+ Bool swap, int reqlen);
-+extern PURE _X_HIDDEN int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXTexSubImage3DReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte *
-- pc, Bool swap);
-+ pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *
-- pc, Bool swap);
-+ pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *
-- pc, Bool swap);
-+ pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXProgramStringARBReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXLoadProgramNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXRequestResidentProgramsNVReqSize(const GLbyte *
-- pc, Bool swap);
-+ pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXPointParameterivNVReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte *
-- pc, Bool swap);
-+ pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *
-- pc, Bool swap);
-+ pc, Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
- extern PURE _X_HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte * pc,
-- Bool swap);
-+ Bool swap, int reqlen);
-
- #undef PURE
-
-diff --git a/glx/rensize.c b/glx/rensize.c
-index 6ee0f9c..a532467 100644
---- a/glx/rensize.c
-+++ b/glx/rensize.c
-@@ -44,7 +44,7 @@
- ((a & 0xff00U)<<8) | ((a & 0xffU)<<24))
-
- int
--__glXMap1dReqSize(const GLbyte * pc, Bool swap)
-+__glXMap1dReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum target;
- GLint order;
-@@ -61,7 +61,7 @@ __glXMap1dReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXMap1fReqSize(const GLbyte * pc, Bool swap)
-+__glXMap1fReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum target;
- GLint order;
-@@ -86,7 +86,7 @@ Map2Size(int k, int majorOrder, int minorOrder)
- }
-
- int
--__glXMap2dReqSize(const GLbyte * pc, Bool swap)
-+__glXMap2dReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum target;
- GLint uorder, vorder;
-@@ -103,7 +103,7 @@ __glXMap2dReqSize(const GLbyte * pc, Bool swap)
- }
-
- int
--__glXMap2fReqSize(const GLbyte * pc, Bool swap)
-+__glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- GLenum target;
- GLint uorder, vorder;
-@@ -359,13 +359,14 @@ __glXTypeSize(GLenum enm)
- }
-
- int
--__glXDrawArraysReqSize(const GLbyte * pc, Bool swap)
-+__glXDrawArraysReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc;
- __GLXdispatchDrawArraysComponentHeader *compHeader;
- GLint numVertexes = hdr->numVertexes;
- GLint numComponents = hdr->numComponents;
- GLint arrayElementSize = 0;
-+ GLint x, size;
- int i;
-
- if (swap) {
-@@ -374,6 +375,13 @@ __glXDrawArraysReqSize(const GLbyte * pc, Bool swap)
- }
-
- pc += sizeof(__GLXdispatchDrawArraysHeader);
-+ reqlen -= sizeof(__GLXdispatchDrawArraysHeader);
-+
-+ size = safe_mul(sizeof(__GLXdispatchDrawArraysComponentHeader),
-+ numComponents);
-+ if (size < 0 || reqlen < 0 || reqlen < size)
-+ return -1;
-+
- compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
-
- for (i = 0; i < numComponents; i++) {
-@@ -417,17 +425,18 @@ __glXDrawArraysReqSize(const GLbyte * pc, Bool swap)
- return -1;
- }
-
-- arrayElementSize += __GLX_PAD(numVals * __glXTypeSize(datatype));
-+ x = safe_pad(safe_mul(numVals, __glXTypeSize(datatype)));
-+ if ((arrayElementSize = safe_add(arrayElementSize, x)) < 0)
-+ return -1;
-
- pc += sizeof(__GLXdispatchDrawArraysComponentHeader);
- }
-
-- return ((numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader)) +
-- (numVertexes * arrayElementSize));
-+ return safe_add(size, safe_mul(numVertexes, arrayElementSize));
- }
-
- int
--__glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap)
-+__glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
- {
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
-diff --git a/include/dix.h b/include/dix.h
-index ea9d2cc..b48d828 100644
---- a/include/dix.h
-+++ b/include/dix.h
-@@ -72,6 +72,10 @@ SOFTWARE.
- if ((sizeof(req) >> 2) > client->req_len )\
- return(BadLength)
-
-+#define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \
-+ if (((sizeof(req) + ((uint64_t) extra)) >> 2) > client->req_len ) \
-+ return(BadLength)
-+
- #define REQUEST_FIXED_SIZE(req, n)\
- if (((sizeof(req) >> 2) > client->req_len) || \
- ((n >> 2) >= client->req_len) || \
-diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c
-index ff9aec5..25eb6e9 100644
---- a/test/xi2/protocol-xipassivegrabdevice.c
-+++ b/test/xi2/protocol-xipassivegrabdevice.c
-@@ -136,6 +136,7 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req,
- {
- int rc;
- int modifiers;
-+ int mask_len;
-
- client_request.req_len = req->length;
- rc = ProcXIPassiveGrabDevice(&client_request);
-@@ -153,10 +154,11 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req,
- swaps(&req->deviceid);
- modifiers = req->num_modifiers;
- swaps(&req->num_modifiers);
-+ mask_len = req->mask_len;
- swaps(&req->mask_len);
-
- while (modifiers--) {
-- CARD32 *mod = ((CARD32 *) (req + 1)) + modifiers;
-+ CARD32 *mod = (CARD32 *) (req + 1) + mask_len + modifiers;
-
- swapl(mod);
- }
-@@ -235,6 +237,11 @@ test_XIPassiveGrabDevice(void)
- request->detail = XIAnyButton;
- request_XIPassiveGrabDevice(&client_request, request, Success, 0);
-
-+ /* Set a few random masks to make sure we handle modifiers correctly */
-+ SetBit(mask, XI_ButtonPress);
-+ SetBit(mask, XI_KeyPress);
-+ SetBit(mask, XI_Enter);
-+
- /* some modifiers */
- request->num_modifiers = N_MODS;
- request->length += N_MODS;
+++ /dev/null
-diff --git a/include/dix.h b/include/dix.h
-index 21176a8..921156b 100644
---- a/include/dix.h
-+++ b/include/dix.h
-@@ -80,7 +80,7 @@ SOFTWARE.
-
- #define REQUEST_FIXED_SIZE(req, n)\
- if (((sizeof(req) >> 2) > client->req_len) || \
-- ((n >> 2) >= client->req_len) || \
-+ (((n) >> 2) >= client->req_len) || \
- ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
- return(BadLength)
-
-diff --git a/os/access.c b/os/access.c
-index f393c8d..28f2d32 100644
---- a/os/access.c
-+++ b/os/access.c
-@@ -1308,7 +1308,7 @@ GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled)
- }
- for (host = validhosts; host; host = host->next) {
- len = host->len;
-- if ((ptr + sizeof(xHostEntry) + len) > (data + n))
-+ if ((ptr + sizeof(xHostEntry) + len) > ((unsigned char *) *data + n))
- break;
- ((xHostEntry *) ptr)->family = host->family;
- ((xHostEntry *) ptr)->length = len;
+++ /dev/null
-From 39547d600a13713e15429f49768e54c3173c828d Mon Sep 17 00:00:00 2001
-From: Karl Tomlinson <xmail@karlt.net>
-Date: Mon, 18 Feb 2013 01:25:34 +0000
-Subject: MakeBigReq: don't move the last word, already handled by Data32
-
-MakeBigReq inserts a length field after the first 4 bytes of the request
-(after req->length), pushing everything else back by 4 bytes.
-
-The current memmove moves everything but the first 4 bytes back.
-If a request aligns to the end of the buffer pointer when MakeBigReq is
-invoked for that request, this runs over the buffer.
-Instead, we need to memmove minus the first 4 bytes (which aren't moved),
-minus the last 4 bytes (so we still align to the previous tail).
-
-The 4 bytes that fell out are already handled with Data32, which will
-handle the buffermax correctly.
-
-The case where req->length = 1 was already not functional.
-
-Reported by Abhishek Arya <inferno@chromium.org>.
-
-https://bugzilla.mozilla.org/show_bug.cgi?id=803762
-
-Reviewed-by: Jeff Muizelaar <jmuizelaar@mozilla.com>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-
-diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
-index 40965c4..06395b3 100644
---- a/include/X11/Xlibint.h
-+++ b/include/X11/Xlibint.h
-@@ -486,6 +486,14 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
- req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq))
- #endif
-
-+/*
-+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
-+ * length, after req->length, before the data in the request. The new length
-+ * includes the "n" extra 32-bit words.
-+ *
-+ * Do not use MakeBigReq if there is no data already in the request.
-+ * req->length must already be >= 2.
-+ */
- #ifdef WORD64
- #define MakeBigReq(req,n) \
- { \
-@@ -493,7 +501,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
- CARD32 _BRlen = req->length - 1; \
- req->length = 0; \
- _BRdat = ((CARD32 *)req)[_BRlen]; \
-- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
-+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
- ((CARD32 *)req)[1] = _BRlen + n + 2; \
- Data32(dpy, &_BRdat, 4); \
- }
-@@ -504,13 +512,20 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
- CARD32 _BRlen = req->length - 1; \
- req->length = 0; \
- _BRdat = ((CARD32 *)req)[_BRlen]; \
-- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
-+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
- ((CARD32 *)req)[1] = _BRlen + n + 2; \
- Data32(dpy, &_BRdat, 4); \
- }
- #endif
- #endif
-
-+/*
-+ * SetReqLen increases the count of 32-bit words in the request by "n",
-+ * or by "badlen" if "n" is too large.
-+ *
-+ * Do not use SetReqLen if "req" does not already have data after the
-+ * xReq header. req->length must already be >= 2.
-+ */
- #ifndef __clang_analyzer__
- #define SetReqLen(req,n,badlen) \
- if ((req->length + n) > (unsigned)65535) { \
---
-cgit v0.10.2
-
+++ /dev/null
-From 81c90dc8f0aae3b65730409b1b615b5fa7280ebd Mon Sep 17 00:00:00 2001
-From: Olivier Fourdan <ofourdan@redhat.com>
-Date: Fri, 16 Jan 2015 20:08:59 +0100
-Subject: xkb: Don't swap XkbSetGeometry data in the input buffer
-
-The XkbSetGeometry request embeds data which needs to be swapped when the
-server and the client have different endianess.
-
-_XkbSetGeometry() invokes functions that swap these data directly in the
-input buffer.
-
-However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once
-(if there is more than one keyboard), thus causing on swapped clients the
-same data to be swapped twice in memory, further causing a server crash
-because the strings lengths on the second time are way off bounds.
-
-To allow _XkbSetGeometry() to run reliably more than once with swapped
-clients, do not swap the data in the buffer, use variables instead.
-
-Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-
-diff --git a/xkb/xkb.c b/xkb/xkb.c
-index 15c7f34..b9a3ac4 100644
---- a/xkb/xkb.c
-+++ b/xkb/xkb.c
-@@ -4961,14 +4961,13 @@ static char *
- _GetCountedString(char **wire_inout, Bool swap)
- {
- char *wire, *str;
-- CARD16 len, *plen;
-+ CARD16 len;
-
- wire = *wire_inout;
-- plen = (CARD16 *) wire;
-+ len = *(CARD16 *) wire;
- if (swap) {
-- swaps(plen);
-+ swaps(&len);
- }
-- len = *plen;
- str = malloc(len + 1);
- if (str) {
- memcpy(str, &wire[2], len);
-@@ -4985,25 +4984,28 @@ _CheckSetDoodad(char **wire_inout,
- {
- char *wire;
- xkbDoodadWireDesc *dWire;
-+ xkbAnyDoodadWireDesc any;
-+ xkbTextDoodadWireDesc text;
- XkbDoodadPtr doodad;
-
- dWire = (xkbDoodadWireDesc *) (*wire_inout);
-+ any = dWire->any;
- wire = (char *) &dWire[1];
- if (client->swapped) {
-- swapl(&dWire->any.name);
-- swaps(&dWire->any.top);
-- swaps(&dWire->any.left);
-- swaps(&dWire->any.angle);
-+ swapl(&any.name);
-+ swaps(&any.top);
-+ swaps(&any.left);
-+ swaps(&any.angle);
- }
- CHK_ATOM_ONLY(dWire->any.name);
-- doodad = XkbAddGeomDoodad(geom, section, dWire->any.name);
-+ doodad = XkbAddGeomDoodad(geom, section, any.name);
- if (!doodad)
- return BadAlloc;
- doodad->any.type = dWire->any.type;
- doodad->any.priority = dWire->any.priority;
-- doodad->any.top = dWire->any.top;
-- doodad->any.left = dWire->any.left;
-- doodad->any.angle = dWire->any.angle;
-+ doodad->any.top = any.top;
-+ doodad->any.left = any.left;
-+ doodad->any.angle = any.angle;
- switch (doodad->any.type) {
- case XkbOutlineDoodad:
- case XkbSolidDoodad:
-@@ -5026,12 +5028,13 @@ _CheckSetDoodad(char **wire_inout,
- dWire->text.colorNdx);
- return BadMatch;
- }
-+ text = dWire->text;
- if (client->swapped) {
-- swaps(&dWire->text.width);
-- swaps(&dWire->text.height);
-+ swaps(&text.width);
-+ swaps(&text.height);
- }
-- doodad->text.width = dWire->text.width;
-- doodad->text.height = dWire->text.height;
-+ doodad->text.width = text.width;
-+ doodad->text.height = text.height;
- doodad->text.color_ndx = dWire->text.colorNdx;
- doodad->text.text = _GetCountedString(&wire, client->swapped);
- doodad->text.font = _GetCountedString(&wire, client->swapped);
---
-cgit v0.10.2
-
-From 20079c36cf7d377938ca5478447d8b9045cb7d43 Mon Sep 17 00:00:00 2001
-From: Olivier Fourdan <ofourdan@redhat.com>
-Date: Fri, 16 Jan 2015 08:44:45 +0100
-Subject: xkb: Check strings length against request size
-
-Ensure that the given strings length in an XkbSetGeometry request remain
-within the limits of the size of the request.
-
-Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-
-diff --git a/xkb/xkb.c b/xkb/xkb.c
-index b9a3ac4..f3988f9 100644
---- a/xkb/xkb.c
-+++ b/xkb/xkb.c
-@@ -4957,25 +4957,29 @@ ProcXkbGetGeometry(ClientPtr client)
-
- /***====================================================================***/
-
--static char *
--_GetCountedString(char **wire_inout, Bool swap)
-+static Status
-+_GetCountedString(char **wire_inout, ClientPtr client, char **str)
- {
-- char *wire, *str;
-+ char *wire, *next;
- CARD16 len;
-
- wire = *wire_inout;
- len = *(CARD16 *) wire;
-- if (swap) {
-+ if (client->swapped) {
- swaps(&len);
- }
-- str = malloc(len + 1);
-- if (str) {
-- memcpy(str, &wire[2], len);
-- str[len] = '\0';
-- }
-- wire += XkbPaddedSize(len + 2);
-- *wire_inout = wire;
-- return str;
-+ next = wire + XkbPaddedSize(len + 2);
-+ /* Check we're still within the size of the request */
-+ if (client->req_len <
-+ bytes_to_int32(next - (char *) client->requestBuffer))
-+ return BadValue;
-+ *str = malloc(len + 1);
-+ if (!*str)
-+ return BadAlloc;
-+ memcpy(*str, &wire[2], len);
-+ *(*str + len) = '\0';
-+ *wire_inout = next;
-+ return Success;
- }
-
- static Status
-@@ -4987,6 +4991,7 @@ _CheckSetDoodad(char **wire_inout,
- xkbAnyDoodadWireDesc any;
- xkbTextDoodadWireDesc text;
- XkbDoodadPtr doodad;
-+ Status status;
-
- dWire = (xkbDoodadWireDesc *) (*wire_inout);
- any = dWire->any;
-@@ -5036,8 +5041,14 @@ _CheckSetDoodad(char **wire_inout,
- doodad->text.width = text.width;
- doodad->text.height = text.height;
- doodad->text.color_ndx = dWire->text.colorNdx;
-- doodad->text.text = _GetCountedString(&wire, client->swapped);
-- doodad->text.font = _GetCountedString(&wire, client->swapped);
-+ status = _GetCountedString(&wire, client, &doodad->text.text);
-+ if (status != Success)
-+ return status;
-+ status = _GetCountedString(&wire, client, &doodad->text.font);
-+ if (status != Success) {
-+ free (doodad->text.text);
-+ return status;
-+ }
- break;
- case XkbIndicatorDoodad:
- if (dWire->indicator.onColorNdx >= geom->num_colors) {
-@@ -5072,7 +5083,9 @@ _CheckSetDoodad(char **wire_inout,
- }
- doodad->logo.color_ndx = dWire->logo.colorNdx;
- doodad->logo.shape_ndx = dWire->logo.shapeNdx;
-- doodad->logo.logo_name = _GetCountedString(&wire, client->swapped);
-+ status = _GetCountedString(&wire, client, &doodad->logo.logo_name);
-+ if (status != Success)
-+ return status;
- break;
- default:
- client->errorValue = _XkbErrCode2(0x4F, dWire->any.type);
-@@ -5304,18 +5317,20 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
- char *wire;
-
- wire = (char *) &req[1];
-- geom->label_font = _GetCountedString(&wire, client->swapped);
-+ status = _GetCountedString(&wire, client, &geom->label_font);
-+ if (status != Success)
-+ return status;
-
- for (i = 0; i < req->nProperties; i++) {
- char *name, *val;
-
-- name = _GetCountedString(&wire, client->swapped);
-- if (!name)
-- return BadAlloc;
-- val = _GetCountedString(&wire, client->swapped);
-- if (!val) {
-+ status = _GetCountedString(&wire, client, &name);
-+ if (status != Success)
-+ return status;
-+ status = _GetCountedString(&wire, client, &val);
-+ if (status != Success) {
- free(name);
-- return BadAlloc;
-+ return status;
- }
- if (XkbAddGeomProperty(geom, name, val) == NULL) {
- free(name);
-@@ -5349,9 +5364,9 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
- for (i = 0; i < req->nColors; i++) {
- char *name;
-
-- name = _GetCountedString(&wire, client->swapped);
-- if (!name)
-- return BadAlloc;
-+ status = _GetCountedString(&wire, client, &name);
-+ if (status != Success)
-+ return status;
- if (!XkbAddGeomColor(geom, name, geom->num_colors)) {
- free(name);
- return BadAlloc;
---
-cgit v0.10.2
-
+++ /dev/null
-From 2deda9906480f9c8ae07b8c2a5510cc7e4c59a8e Mon Sep 17 00:00:00 2001
-From: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri, 6 Feb 2015 15:50:45 -0800
-Subject: bdfReadProperties: property count needs range check [CVE-2015-1802]
-
-Avoid integer overflow or underflow when allocating memory arrays
-by multiplying the number of properties reported for a BDF font.
-
-Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
-Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-Reviewed-by: Julien Cristau <jcristau@debian.org>
-
-diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c
-index 914a024..6387908 100644
---- a/src/bitmap/bdfread.c
-+++ b/src/bitmap/bdfread.c
-@@ -604,7 +604,9 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState)
- bdfError("missing 'STARTPROPERTIES'\n");
- return (FALSE);
- }
-- if (sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) {
-+ if ((sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) ||
-+ (nProps <= 0) ||
-+ (nProps > ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) {
- bdfError("bad 'STARTPROPERTIES'\n");
- return (FALSE);
- }
---
-cgit v0.10.2
-
+++ /dev/null
-From 78c2e3d70d29698244f70164428bd2868c0ab34c Mon Sep 17 00:00:00 2001
-From: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri, 6 Feb 2015 15:54:00 -0800
-Subject: bdfReadCharacters: bailout if a char's bitmap cannot be read
- [CVE-2015-1803]
-
-Previously would charge on ahead with a NULL pointer in ci->bits, and
-then crash later in FontCharInkMetrics() trying to access the bits.
-
-Found with afl-1.23b.
-
-Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-Reviewed-by: Julien Cristau <jcristau@debian.org>
-
-diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c
-index 6387908..1b29b81 100644
---- a/src/bitmap/bdfread.c
-+++ b/src/bitmap/bdfread.c
-@@ -458,7 +458,10 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
- ci->metrics.descent = -bb;
- ci->metrics.characterWidth = wx;
- ci->bits = NULL;
-- bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes);
-+ if (!bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes)) {
-+ bdfError("could not read bitmap for character '%s'\n", charName);
-+ goto BAILOUT;
-+ }
- ci++;
- ndx++;
- } else
---
-cgit v0.10.2
-
+++ /dev/null
-From 2351c83a77a478b49cba6beb2ad386835e264744 Mon Sep 17 00:00:00 2001
-From: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri, 6 Mar 2015 22:54:58 -0800
-Subject: bdfReadCharacters: ensure metrics fit into xCharInfo struct
- [CVE-2015-1804]
-
-We use 32-bit ints to read from the bdf file, but then try to stick
-into a 16-bit int in the xCharInfo struct, so make sure they won't
-overflow that range.
-
-Found by afl-1.24b.
-
-v2: Verify that additions won't overflow 32-bit int range either.
-v3: As Julien correctly observes, the previous check for bh & bw not
- being < 0 reduces the number of cases we need to check for overflow.
-
-Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-Reviewed-by: Julien Cristau <jcristau@debian.org>
-
-diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c
-index 1b29b81..a0ace8f 100644
---- a/src/bitmap/bdfread.c
-+++ b/src/bitmap/bdfread.c
-@@ -62,8 +62,16 @@ from The Open Group.
-
- #if HAVE_STDINT_H
- #include <stdint.h>
--#elif !defined(INT32_MAX)
--#define INT32_MAX 0x7fffffff
-+#else
-+# ifndef INT32_MAX
-+# define INT32_MAX 0x7fffffff
-+# endif
-+# ifndef INT16_MAX
-+# define INT16_MAX 0x7fff
-+# endif
-+# ifndef INT16_MIN
-+# define INT16_MIN (0 - 0x8000)
-+# endif
- #endif
-
- #define INDICES 256
-@@ -417,6 +425,12 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
- bdfError("DWIDTH y value must be zero\n");
- goto BAILOUT;
- }
-+ /* xCharInfo metrics are stored as INT16 */
-+ if ((wx < 0) || (wx > INT16_MAX)) {
-+ bdfError("character '%s' has out of range width, %d\n",
-+ charName, wx);
-+ goto BAILOUT;
-+ }
- line = bdfGetLine(file, lineBuf, BDFLINELEN);
- if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) {
- bdfError("bad 'BBX'\n");
-@@ -427,6 +441,14 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
- charName, bw, bh);
- goto BAILOUT;
- }
-+ /* xCharInfo metrics are read as int, but stored as INT16 */
-+ if ((bl > INT16_MAX) || (bl < INT16_MIN) ||
-+ (bb > INT16_MAX) || (bb < INT16_MIN) ||
-+ (bw > (INT16_MAX - bl)) || (bh > (INT16_MAX - bb))) {
-+ bdfError("character '%s' has out of range metrics, %d %d %d %d\n",
-+ charName, bl, (bl+bw), (bh+bb), -bb);
-+ goto BAILOUT;
-+ }
- line = bdfGetLine(file, lineBuf, BDFLINELEN);
- if ((line) && (bdfIsPrefix(line, "ATTRIBUTES"))) {
- for (p = line + strlen("ATTRIBUTES ");
---
-cgit v0.10.2
-
+++ /dev/null
-# - Find X11 installation
-# Try to find X11 on UNIX systems. The following values are defined
-# X11_FOUND - True if X11 is available
-# X11_INCLUDE_DIR - include directories to use X11
-# X11_LIBRARIES - link against these to use X11
-#
-# and also the following more fine grained variables:
-# Include paths: X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND
-# X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND
-# X11_X11_INCLUDE_PATH, X11_X11_LIB
-# X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
-# X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
-# X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
-# X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
-# X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
-# X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
-# X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
-# X11_Xext_LIB, X11_Xext_FOUND
-# X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
-# X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
-# X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
-# X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
-# X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND
-# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
-# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
-# X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
-# X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
-# X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
-# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
-# X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
-# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
-# X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND
-# X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
-# X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
-# X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
-# X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
-# X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
-# X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
-# X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
-# X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
-# X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
-
-
-#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-if (UNIX)
- set(X11_FOUND 0)
- # X11 is never a framework and some header files may be
- # found in tcl on the mac
- set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
- set(CMAKE_FIND_FRAMEWORK NEVER)
- set(X11_INC_SEARCH_PATH
- @_includedir@
- /usr/pkg/xorg/include
- /usr/X11R6/include
- /usr/X11R7/include
- /usr/include/X11
- /usr/openwin/include
- /usr/openwin/share/include
- /opt/graphics/OpenGL/include
- )
-
-
- set(X11_LIB_SEARCH_PATH
- @_libdir@
- @_libdir@/tigervnc
- /usr/pkg/xorg/lib
- /usr/X11R6/lib
- /usr/X11R7/lib
- /usr/openwin/lib
- )
-
- find_path(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH})
-
- # Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH
- # variable (which doesn't need to match the include file name).
-
- # Solaris lacks XKBrules.h, so we should skip kxkbd there.
- find_path(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH})
- find_path(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH})
- find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH})
- find_path(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH})
- find_path(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH})
- find_path(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
- find_path(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH})
- find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
- find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
- find_path(X11_xcb_INCLUDE_PATH X11/xcb.h ${X11_INC_SEARCH_PATH})
-
-
- find_library(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
-
- # Find additional X libraries. Keep list sorted by library name.
- find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
- find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xdmcp_LIB Xdmcp ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
- find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
- find_library(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})
- find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH})
-
- set(X11_LIBRARY_DIR "")
- if(X11_X11_LIB)
- get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
- endif()
-
- set(X11_INCLUDE_DIR) # start with empty list
- if(X11_X11_INCLUDE_PATH)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
- endif()
-
- if(X11_Xlib_INCLUDE_PATH)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
- endif()
-
- if(X11_Xutil_INCLUDE_PATH)
- set(X11_Xutil_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
- endif()
-
- if(X11_Xshape_INCLUDE_PATH)
- set(X11_Xshape_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
- endif()
-
- set(X11_LIBRARIES) # start with empty list
- if(X11_X11_LIB)
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB} ${X11_xcb_LIB})
- endif()
-
- if(X11_Xext_LIB)
- set(X11_Xext_FOUND TRUE)
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
- endif()
-
- if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
- set(X11_Xt_FOUND TRUE)
- endif()
-
- if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
- set(X11_Xft_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
- endif()
-
- if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
- set(X11_Xv_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
- endif()
-
- if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
- set(X11_Xau_FOUND TRUE)
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xau_LIB})
- endif ()
-
- if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
- set(X11_Xdmcp_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xdmcp_LIB})
- endif ()
-
- if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
- set(X11_Xaccess_FOUND TRUE)
- set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
- endif ()
-
- if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
- set(X11_Xpm_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
- endif ()
-
- if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
- set(X11_Xcomposite_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
- endif ()
-
- if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
- set(X11_Xdamage_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
- endif ()
-
- if (X11_XShm_INCLUDE_PATH)
- set(X11_XShm_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
- endif ()
-
- if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
- set(X11_XTest_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
- endif ()
-
- if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
- set(X11_Xi_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
- endif ()
-
- if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
- set(X11_Xinerama_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
- endif ()
-
- if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
- set(X11_Xfixes_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
- endif ()
-
- if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
- set(X11_Xrender_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
- endif ()
-
- if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
- set(X11_XRes_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
- endif ()
-
- if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
- set(X11_Xrandr_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
- endif ()
-
- if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
- set(X11_xf86misc_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
- endif ()
-
- if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
- set(X11_xf86vmode_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
- endif ()
-
- if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
- set(X11_Xcursor_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
- endif ()
-
- if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
- set(X11_Xscreensaver_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
- endif ()
-
- if (X11_dpms_INCLUDE_PATH)
- set(X11_dpms_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
- endif ()
-
- if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
- set(X11_Xkb_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
- endif ()
-
- if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
- set(X11_Xkbfile_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
- endif ()
-
- if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
- set(X11_Xmu_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
- endif ()
-
- if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
- set(X11_Xinput_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
- endif ()
-
- if (X11_XSync_INCLUDE_PATH)
- set(X11_XSync_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
- endif ()
-
- if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
- set(X11_ICE_FOUND TRUE)
- endif()
-
- if(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
- set(X11_SM_FOUND TRUE)
- endif()
-
- if(X11_xcb_LIB AND X11_xcb_INCLUDE_PATH)
- set(X11_xcb_FOUND TRUE)
- endif()
-
- # Most of the X11 headers will be in the same directories, avoid
- # creating a huge list of duplicates.
- if (X11_INCLUDE_DIR)
- list(REMOVE_DUPLICATES X11_INCLUDE_DIR)
- endif ()
-
- # Deprecated variable for backwards compatibility with CMake 1.4
- if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
- set(X11_FOUND 1)
- endif ()
-
- if(X11_FOUND)
- include(/usr/share/cmake28/Modules/CheckFunctionExists.cmake)
- include(/usr/share/cmake28/Modules/CheckLibraryExists.cmake)
-
- # Translated from an autoconf-generated configure script.
- # See libs.m4 in autoconf's m4 directory.
- if($ENV{ISC} MATCHES "^yes$")
- set(X11_X_EXTRA_LIBS -lnsl_s -linet)
- else()
- set(X11_X_EXTRA_LIBS "-Wl,-Bdynamic -ldl")
-
- # See if XOpenDisplay in X11 works by itself.
- CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
- if(NOT X11_LIB_X11_SOLO)
- # Find library needed for dnet_ntoa.
- CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
- if (X11_LIB_DNET_HAS_DNET_NTOA)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
- else ()
- CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
- if (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
- endif ()
- endif ()
- endif()
-
- # Find library needed for gethostbyname.
- CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
- if(NOT CMAKE_HAVE_GETHOSTBYNAME)
- CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
- if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
- else ()
- CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
- if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
- endif ()
- endif ()
- endif()
-
- # Find library needed for connect.
- CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
- if(NOT CMAKE_HAVE_CONNECT)
- CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
- if (CMAKE_LIB_SOCKET_HAS_CONNECT)
- set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
- endif ()
- endif()
-
- # Find library needed for remove.
- CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
- if(NOT CMAKE_HAVE_REMOVE)
- CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
- if (CMAKE_LIB_POSIX_HAS_REMOVE)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
- endif ()
- endif()
-
- # Find library needed for shmat.
- CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
- if(NOT CMAKE_HAVE_SHMAT)
- CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
- if (CMAKE_LIB_IPS_HAS_SHMAT)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
- endif ()
- endif()
- endif()
-
- if (X11_ICE_FOUND)
- CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
- CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
- if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
- set (X11_X_PRE_LIBS ${X11_ICE_LIB})
- if(X11_SM_LIB)
- set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
- endif()
- endif()
- endif ()
-
- # Build the final list of libraries.
- set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
-
- include(/usr/share/cmake28/Modules/FindPackageMessage.cmake)
- FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
- "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
- else ()
- if (X11_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find X11")
- endif ()
- endif ()
-
- mark_as_advanced(
- X11_X11_INCLUDE_PATH
- X11_X11_LIB
- X11_Xext_LIB
- X11_Xau_LIB
- X11_Xau_INCLUDE_PATH
- X11_Xlib_INCLUDE_PATH
- X11_Xutil_INCLUDE_PATH
- X11_Xcomposite_INCLUDE_PATH
- X11_Xcomposite_LIB
- X11_Xaccess_INCLUDE_PATH
- X11_Xfixes_LIB
- X11_Xfixes_INCLUDE_PATH
- X11_Xrandr_LIB
- X11_Xrandr_INCLUDE_PATH
- X11_Xdamage_LIB
- X11_Xdamage_INCLUDE_PATH
- X11_Xrender_LIB
- X11_Xrender_INCLUDE_PATH
- X11_XRes_LIB
- X11_XRes_INCLUDE_PATH
- X11_Xxf86misc_LIB
- X11_xf86misc_INCLUDE_PATH
- X11_Xxf86vm_LIB
- X11_xf86vmode_INCLUDE_PATH
- X11_Xi_LIB
- X11_Xi_INCLUDE_PATH
- X11_Xinerama_LIB
- X11_Xinerama_INCLUDE_PATH
- X11_XTest_LIB
- X11_XTest_INCLUDE_PATH
- X11_Xcursor_LIB
- X11_Xcursor_INCLUDE_PATH
- X11_dpms_INCLUDE_PATH
- X11_Xt_LIB
- X11_Xt_INCLUDE_PATH
- X11_Xdmcp_LIB
- X11_LIBRARIES
- X11_Xaccessrules_INCLUDE_PATH
- X11_Xaccessstr_INCLUDE_PATH
- X11_Xdmcp_INCLUDE_PATH
- X11_Xkb_INCLUDE_PATH
- X11_Xkblib_INCLUDE_PATH
- X11_Xkbfile_INCLUDE_PATH
- X11_Xkbfile_LIB
- X11_Xmu_INCLUDE_PATH
- X11_Xmu_LIB
- X11_Xscreensaver_INCLUDE_PATH
- X11_Xscreensaver_LIB
- X11_Xpm_INCLUDE_PATH
- X11_Xpm_LIB
- X11_Xinput_LIB
- X11_Xinput_INCLUDE_PATH
- X11_Xft_LIB
- X11_Xft_INCLUDE_PATH
- X11_Xshape_INCLUDE_PATH
- X11_Xv_LIB
- X11_Xv_INCLUDE_PATH
- X11_XShm_INCLUDE_PATH
- X11_ICE_LIB
- X11_ICE_INCLUDE_PATH
- X11_SM_LIB
- X11_SM_INCLUDE_PATH
- X11_xcb_LIB
- X11_xcb_INCLUDE_PATH
- X11_XSync_INCLUDE_PATH
- )
- set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
-endif ()
-
-# X11_FIND_REQUIRED_<component> could be checked too
+++ /dev/null
---- a/configure 2015-02-22 16:20:48.000000000 -0500
-+++ b/configure 2015-02-22 16:21:52.000000000 -0500
-@@ -6793,7 +6793,7 @@
- # See if we find them without any special options.
- # Don't add to $LIBS permanently.
- ac_save_LIBS=$LIBS
-- LIBS="-lX11 $LIBS"
-+ LIBS="-lX11 -lfreetype -lexpat -lXext -lXrender -lxcb -lXdmcp -lXau -lz $LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <X11/Xlib.h>
-@@ -6935,7 +6935,7 @@
- # Martyn Johnson says this is needed for Ultrix, if the X
- # libraries were built with DECnet support. And Karl Berry says
- # the Alpha needs dnet_stub (dnet does not exist).
-- ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
-+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lfreetype -lexpat -lX11 -lXext -lXrender -lxcb -lXdmcp -lXau -lz"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-@@ -7359,7 +7359,7 @@
- $as_echo "$as_me: WARNING: Ignoring libraries \"$X_PRE_LIBS\" requested by configure." >&2;}
- fi
-
-- LIBS="$LIBS -lX11 $X_EXTRA_LIBS"
-+ LIBS="$LIBS -lfreetype -lexpat -lX11 -lXext -lXrender -lxcb -lXdmcp -lXau -lz $X_EXTRA_LIBS"
- CFLAGS="$CFLAGS $X_CFLAGS"
- CXXFLAGS="$CXXFLAGS $X_CFLAGS"
- LDFLAGS="$X_LIBS $LDFLAGS"
+++ /dev/null
---- freetype-2.1.10/include/freetype/config/ftoption.h.enable-ft2-bci 2005-10-12 13:50:40.000000000 -0400
-+++ freetype-2.1.10/include/freetype/config/ftoption.h 2005-10-12 14:18:50.000000000 -0400
-@@ -436,7 +436,7 @@
- /* Do not #undef this macro here, since the build system might */
- /* define it for certain configurations only. */
- /* */
--/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
-+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
-
- /*************************************************************************/
+++ /dev/null
---- freetype-2.2.1/modules.cfg.orig 2006-07-07 21:01:09.000000000 -0400
-+++ freetype-2.2.1/modules.cfg 2006-07-07 21:01:54.000000000 -0400
-@@ -110,7 +110,7 @@
- AUX_MODULES += cache
-
- # TrueType GX/AAT table validation. Needs ftgxval.c below.
--# AUX_MODULES += gxvalid
-+AUX_MODULES += gxvalid
-
- # Support for streams compressed with gzip (files with suffix .gz).
- #
-@@ -124,7 +124,7 @@
-
- # OpenType table validation. Needs ftotval.c below.
- #
--# AUX_MODULES += otvalid
-+AUX_MODULES += otvalid
-
- # Auxiliary PostScript driver component to share common code.
- #
+++ /dev/null
---- freetype-2.3.0/include/freetype/config/ftoption.h.spf 2007-01-18 14:27:34.000000000 -0500
-+++ freetype-2.3.0/include/freetype/config/ftoption.h 2007-01-18 14:27:48.000000000 -0500
-@@ -92,7 +92,7 @@
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
- /* */
--/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /*************************************************************************/
+++ /dev/null
---- freetype-2.3.11/src/cff/cffgload.c.CVE-2010-1797-2 2009-09-10 17:52:21.000000000 +0200
-+++ freetype-2.3.11/src/cff/cffgload.c 2010-08-11 13:39:32.000000000 +0200
-@@ -2358,8 +2358,11 @@
- return CFF_Err_Unimplemented_Feature;
- }
-
-- decoder->top = args;
-+ decoder->top = args;
-
-+ if ( decoder->top - stack >= CFF_MAX_OPERANDS )
-+ goto Stack_Overflow;
-+
- } /* general operator processing */
-
- } /* while ip < limit */
-@@ -2627,48 +2630,54 @@
- /* now load the unscaled outline */
- error = cff_get_glyph_data( face, glyph_index,
- &charstring, &charstring_len );
-- if ( !error )
-- {
-- error = cff_decoder_prepare( &decoder, size, glyph_index );
-- if ( !error )
-- {
-- error = cff_decoder_parse_charstrings( &decoder,
-- charstring,
-- charstring_len );
-+ if ( error )
-+ goto Glyph_Build_Finished;
-+
-+ error = cff_decoder_prepare( &decoder, size, glyph_index );
-+ if ( error )
-+ goto Glyph_Build_Finished;
-
-- cff_free_glyph_data( face, &charstring, charstring_len );
-+ error = cff_decoder_parse_charstrings( &decoder,
-+ charstring,
-+ charstring_len );
-+
-+ cff_free_glyph_data( face, &charstring, charstring_len );
-+
-+ if ( error )
-+ goto Glyph_Build_Finished;
-
-
- #ifdef FT_CONFIG_OPTION_INCREMENTAL
-- /* Control data and length may not be available for incremental */
-- /* fonts. */
-- if ( face->root.internal->incremental_interface )
-- {
-- glyph->root.control_data = 0;
-- glyph->root.control_len = 0;
-- }
-- else
-+ /* Control data and length may not be available for incremental */
-+ /* fonts. */
-+ if ( face->root.internal->incremental_interface )
-+ {
-+ glyph->root.control_data = 0;
-+ glyph->root.control_len = 0;
-+ }
-+ else
- #endif /* FT_CONFIG_OPTION_INCREMENTAL */
-
-- /* We set control_data and control_len if charstrings is loaded. */
-- /* See how charstring loads at cff_index_access_element() in */
-- /* cffload.c. */
-- {
-- CFF_Index csindex = &cff->charstrings_index;
-+ /* We set control_data and control_len if charstrings is loaded. */
-+ /* See how charstring loads at cff_index_access_element() in */
-+ /* cffload.c. */
-+ {
-+ CFF_Index csindex = &cff->charstrings_index;
-
-
-- if ( csindex->offsets )
-- {
-- glyph->root.control_data = csindex->bytes +
-- csindex->offsets[glyph_index] - 1;
-- glyph->root.control_len = charstring_len;
-- }
-- }
-+ if ( csindex->offsets )
-+ {
-+ glyph->root.control_data = csindex->bytes +
-+ csindex->offsets[glyph_index] - 1;
-+ glyph->root.control_len = charstring_len;
- }
- }
-
-- /* save new glyph tables */
-- cff_builder_done( &decoder.builder );
-+ Glyph_Build_Finished:
-+ /* save new glyph tables, if no error */
-+ if ( !error )
-+ cff_builder_done( &decoder.builder );
-+ /* XXX: anything to do for broken glyph entry? */
- }
-
- #ifdef FT_CONFIG_OPTION_INCREMENTAL
+++ /dev/null
---- freetype-2.3.11/src/pshinter/pshalgo.c 2009-07-03 15:28:24.000000000 +0200
-+++ freetype-2.3.11/src/pshinter/pshalgo.c 2010-07-13 13:14:22.000000000 +0200
-@@ -4,7 +4,8 @@
- /* */
- /* PostScript hinting algorithm (body). */
- /* */
--/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
-+/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 */
-+/* by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used */
-@@ -1690,7 +1691,10 @@
- /* process secondary hints to `selected' points */
- if ( num_masks > 1 && glyph->num_points > 0 )
- {
-- first = mask->end_point;
-+ /* the `endchar' op can reduce the number of points */
-+ first = mask->end_point > glyph->num_points
-+ ? glyph->num_points
-+ : mask->end_point;
- mask++;
- for ( ; num_masks > 1; num_masks--, mask++ )
- {
-@@ -1698,7 +1702,9 @@
- FT_Int count;
-
-
-- next = mask->end_point;
-+ next = mask->end_point > glyph->num_points
-+ ? glyph->num_points
-+ : mask->end_point;
- count = next - first;
- if ( count > 0 )
- {
+++ /dev/null
---- freetype-2.3.11/src/base/ftobjs.c 2009-09-02 08:42:41.000000000 +0200
-+++ freetype-2.3.11/src/base/ftobjs.c 2010-07-12 16:39:13.000000000 +0200
-@@ -1531,6 +1531,8 @@
- len += rlen;
- else
- {
-+ if ( pfb_lenpos + 3 > pfb_len + 2 )
-+ goto Exit2;
- pfb_data[pfb_lenpos ] = (FT_Byte)( len );
- pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 );
- pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 );
-@@ -1539,6 +1541,8 @@
- if ( ( flags >> 8 ) == 5 ) /* End of font mark */
- break;
-
-+ if ( pfb_pos + 6 > pfb_len + 2 )
-+ goto Exit2;
- pfb_data[pfb_pos++] = 0x80;
-
- type = flags >> 8;
-@@ -1553,12 +1557,18 @@
- }
-
- error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
-+ if ( error )
-+ goto Exit2;
- pfb_pos += rlen;
- }
-
-+ if ( pfb_pos + 2 > pfb_len + 2 )
-+ goto Exit2;
- pfb_data[pfb_pos++] = 0x80;
- pfb_data[pfb_pos++] = 3;
-
-+ if ( pfb_lenpos + 3 > pfb_len + 2 )
-+ goto Exit2;
- pfb_data[pfb_lenpos ] = (FT_Byte)( len );
- pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 );
- pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 );
+++ /dev/null
---- freetype-2.3.11/src/smooth/ftgrays.c 2009-07-31 18:45:19.000000000 +0200
-+++ freetype-2.3.11/src/smooth/ftgrays.c 2010-07-13 10:26:58.000000000 +0200
-@@ -1189,7 +1189,7 @@
- /* first of all, compute the scanline offset */
- p = (unsigned char*)map->buffer - y * map->pitch;
- if ( map->pitch >= 0 )
-- p += ( map->rows - 1 ) * map->pitch;
-+ p += (unsigned)( ( map->rows - 1 ) * map->pitch );
-
- for ( ; count > 0; count--, spans++ )
- {
---- freetype-2.3.11/src/smooth/ftsmooth.c 2009-07-31 18:45:19.000000000 +0200
-+++ freetype-2.3.11/src/smooth/ftsmooth.c 2010-07-13 10:26:58.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* Anti-aliasing renderer interface (body). */
- /* */
--/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */
-+/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -200,7 +200,7 @@
-
- /* Required check is ( pitch * height < FT_ULONG_MAX ), */
- /* but we care realistic cases only. Always pitch <= width. */
-- if ( width > 0xFFFFU || height > 0xFFFFU )
-+ if ( width > 0x7FFFU || height > 0x7FFFU )
- {
- FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n",
- width, height ));
+++ /dev/null
---- freetype-2.3.11/src/base/ftobjs.c 2010-07-12 17:03:47.000000000 +0200
-+++ freetype-2.3.11/src/base/ftobjs.c 2010-07-12 17:07:06.000000000 +0200
-@@ -1526,7 +1526,19 @@
- goto Exit;
- if ( FT_READ_USHORT( flags ) )
- goto Exit;
-- rlen -= 2; /* the flags are part of the resource */
-+ FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
-+ i, offsets[i], rlen, flags ));
-+
-+ if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */
-+ continue;
-+
-+ /* the flags are part of the resource, so rlen >= 2. */
-+ /* but some fonts declare rlen = 0 for empty fragment */
-+ if ( rlen > 2 )
-+ rlen -= 2;
-+ else
-+ rlen = 0;
-+
- if ( ( flags >> 8 ) == type )
- len += rlen;
- else
+++ /dev/null
---- freetype-2.3.11/src/truetype/ttinterp.c 2009-07-31 18:45:19.000000000 +0200
-+++ freetype-2.3.11/src/truetype/ttinterp.c 2010-07-15 14:44:23.000000000 +0200
-@@ -6466,8 +6466,8 @@
- end_point = CUR.pts.contours[contour] - CUR.pts.first_point;
- first_point = point;
-
-- if ( CUR.pts.n_points <= end_point )
-- end_point = CUR.pts.n_points;
-+ if ( BOUNDS ( end_point, CUR.pts.n_points ) )
-+ end_point = CUR.pts.n_points - 1;
-
- while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 )
- point++;
+++ /dev/null
---- freetype-2.3.11/ft2demos-2.3.11/src/ftdiff.c 2009-04-30 18:07:48.000000000 +0200
-+++ freetype-2.3.11/ft2demos-2.3.11/src/ftdiff.c 2010-07-22 18:18:06.000000000 +0200
-@@ -1054,11 +1054,11 @@
-
- state->message = state->message0;
- if ( total > 1 )
-- sprintf( state->message0, "%s %d/%d @ %5.1fpt",
-+ sprintf( state->message0, "%.100s %d/%d @ %5.1fpt",
- state->filename, idx + 1, total,
- state->char_size );
- else
-- sprintf( state->message0, "%s @ %5.1fpt",
-+ sprintf( state->message0, "%.100s @ %5.1fpt",
- state->filename,
- state->char_size );
- }
---- freetype-2.3.11/ft2demos-2.3.11/src/ftgrid.c 2009-04-30 18:15:21.000000000 +0200
-+++ freetype-2.3.11/ft2demos-2.3.11/src/ftgrid.c 2010-07-22 18:18:06.000000000 +0200
-@@ -2,7 +2,7 @@
- /* */
- /* The FreeType project -- a free and portable quality TrueType renderer. */
- /* */
--/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009 by */
-+/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
- /* D. Turner, R.Wilhelm, and W. Lemberg */
- /* */
- /* */
-@@ -787,22 +787,22 @@ grid_status_draw_outline( GridStatus
- switch ( error_code )
- {
- case FT_Err_Ok:
-- sprintf( status.header_buffer, "%s %s (file `%s')",
-+ sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')",
- face->family_name, face->style_name, basename );
- break;
-
- case FT_Err_Invalid_Pixel_Size:
-- sprintf( status.header_buffer, "Invalid pixel size (file `%s')",
-+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')",
- basename );
- break;
-
- case FT_Err_Invalid_PPem:
-- sprintf( status.header_buffer, "Invalid ppem value (file `%s')",
-+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')",
- basename );
- break;
-
- default:
-- sprintf( status.header_buffer, "File `%s': error 0x%04x",
-+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x",
- basename, (FT_UShort)error_code );
- break;
- }
---- freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2009-03-14 14:58:28.000000000 +0100
-+++ freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2010-07-22 18:18:39.000000000 +0200
-@@ -2,7 +2,7 @@
- /* */
- /* The FreeType project -- a free and portable quality TrueType renderer. */
- /* */
--/* Copyright 1996-2000, 2003, 2004, 2005 by */
-+/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */
- /* D. Turner, R.Wilhelm, and W. Lemberg */
- /* */
- /* */
-@@ -34,7 +34,7 @@
-
- #define MAXPTSIZE 500 /* dtp */
-
-- char Header[128];
-+ char Header[256];
- char* new_header = 0;
-
- const unsigned char* Text = (unsigned char*)
-@@ -795,7 +795,7 @@
- Render_All( Num, ptsize );
- }
-
-- sprintf( Header, "%s %s (file %s)",
-+ sprintf( Header, "%.50s %.50s (file %.100s)",
- face->family_name,
- face->style_name,
- ft_basename( argv[file] ) );
-@@ -830,7 +830,7 @@
- }
- else
- {
-- sprintf( Header, "%s: not an MM font file, or could not be opened",
-+ sprintf( Header, "%.100s: not an MM font file, or could not be opened",
- ft_basename( argv[file] ) );
- }
-
---- freetype-2.3.11/ft2demos-2.3.11/src/ftstring.c 2009-03-14 14:58:28.000000000 +0100
-+++ freetype-2.3.11/ft2demos-2.3.11/src/ftstring.c 2010-07-22 18:18:06.000000000 +0200
-@@ -2,7 +2,7 @@
- /* */
- /* The FreeType project -- a free and portable quality TrueType renderer. */
- /* */
--/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
-+/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
- /* D. Turner, R.Wilhelm, and W. Lemberg */
- /* */
- /* */
-@@ -413,19 +413,20 @@
- switch ( error_code )
- {
- case FT_Err_Ok:
-- sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name,
-+ sprintf( status.header_buffer,
-+ "%.50s %.50s (file `%.100s')", face->family_name,
- face->style_name, basename );
- break;
- case FT_Err_Invalid_Pixel_Size:
-- sprintf( status.header_buffer, "Invalid pixel size (file `%s')",
-+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')",
- basename );
- break;
- case FT_Err_Invalid_PPem:
-- sprintf( status.header_buffer, "Invalid ppem value (file `%s')",
-+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')",
- basename );
- break;
- default:
-- sprintf( status.header_buffer, "File `%s': error 0x%04x", basename,
-+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename,
- (FT_UShort)error_code );
- break;
- }
---- freetype-2.3.11/ft2demos-2.3.11/src/ftview.c 2009-04-30 20:08:25.000000000 +0200
-+++ freetype-2.3.11/ft2demos-2.3.11/src/ftview.c 2010-07-22 18:18:06.000000000 +0200
-@@ -1086,19 +1086,19 @@
- switch ( error_code )
- {
- case FT_Err_Ok:
-- sprintf( status.header_buffer, "%s %s (file `%s')",
-+ sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')",
- face->family_name, face->style_name, basename );
- break;
- case FT_Err_Invalid_Pixel_Size:
-- sprintf( status.header_buffer, "Invalid pixel size (file `%s')",
-+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')",
- basename );
- break;
- case FT_Err_Invalid_PPem:
-- sprintf( status.header_buffer, "Invalid ppem value (file `%s')",
-+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')",
- basename );
- break;
- default:
-- sprintf( status.header_buffer, "File `%s': error 0x%04x",
-+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x",
- basename, (FT_UShort)error_code );
- break;
- }
+++ /dev/null
---- freetype-2.3.11/src/base/ftstream.c 2009-08-03 19:51:40.000000000 +0200
-+++ freetype-2.3.11/src/base/ftstream.c 2010-09-30 13:46:08.000000000 +0200
-@@ -275,7 +275,7 @@
- {
- /* check current and new position */
- if ( stream->pos >= stream->size ||
-- stream->pos + count > stream->size )
-+ stream->size - stream->pos < count )
- {
- FT_ERROR(( "FT_Stream_EnterFrame:"
- " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n",
+++ /dev/null
---- freetype-2.3.11/src/type42/t42parse.c 2009-07-03 15:28:24.000000000 +0200
-+++ freetype-2.3.11/src/type42/t42parse.c 2010-09-23 12:15:56.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* Type 42 font parser (body). */
- /* */
--/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
-+/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
- /* Roberto Alameda. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -575,6 +575,12 @@
- }
-
- string_size = T1_ToInt( parser );
-+ if ( string_size < 0 )
-+ {
-+ FT_ERROR(( "t42_parse_sfnts: invalid string size\n" ));
-+ error = T42_Err_Invalid_File_Format;
-+ goto Fail;
-+ }
-
- T1_Skip_PS_Token( parser ); /* `RD' */
- if ( parser->root.error )
-@@ -582,13 +588,14 @@
-
- string_buf = parser->root.cursor + 1; /* one space after `RD' */
-
-- parser->root.cursor += string_size + 1;
-- if ( parser->root.cursor >= limit )
-+ if ( limit - parser->root.cursor < string_size )
- {
- FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
- error = T42_Err_Invalid_File_Format;
- goto Fail;
- }
-+ else
-+ parser->root.cursor += string_size + 1;
- }
-
- if ( !string_buf )
+++ /dev/null
---- freetype-2.3.11/src/base/ftobjs.c 2010-09-30 13:58:50.000000000 +0200
-+++ freetype-2.3.11/src/base/ftobjs.c 2010-09-30 13:59:31.000000000 +0200
-@@ -1529,6 +1529,7 @@
- FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
- i, offsets[i], rlen, flags ));
-
-+ /* postpone the check of rlen longer than buffer until FT_Stream_Read() */
- if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */
- continue;
-
-@@ -1568,6 +1569,10 @@
- pfb_data[pfb_pos++] = 0;
- }
-
-+ error = FT_Err_Cannot_Open_Resource;
-+ if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
-+ goto Exit2;
-+
- error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
- if ( error )
- goto Exit2;
+++ /dev/null
---- freetype-2.3.11/src/base/ftstream.c 2010-09-30 14:12:38.000000000 +0200
-+++ freetype-2.3.11/src/base/ftstream.c 2010-09-30 14:12:59.000000000 +0200
-@@ -59,8 +59,17 @@
- {
- FT_Error error = FT_Err_Ok;
-
-+ /* note that seeking to the first position after the file is valid */
-+ if ( pos > stream->size )
-+ {
-+ FT_ERROR(( "FT_Stream_Seek:"
-+ " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
-+ pos, stream->size ));
-
-- if ( stream->read )
-+ error = FT_Err_Invalid_Stream_Operation;
-+ }
-+
-+ if ( !error && stream->read )
- {
- if ( stream->read( stream, pos, 0, 0 ) )
- {
-@@ -71,15 +80,6 @@
- error = FT_Err_Invalid_Stream_Operation;
- }
- }
-- /* note that seeking to the first position after the file is valid */
-- else if ( pos > stream->size )
-- {
-- FT_ERROR(( "FT_Stream_Seek:"
-- " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
-- pos, stream->size ));
--
-- error = FT_Err_Invalid_Stream_Operation;
-- }
-
- if ( !error )
- stream->pos = pos;
+++ /dev/null
---- freetype-2.3.11/src/truetype/ttgxvar.c.orig 2009-07-31 18:45:19.000000000 +0200
-+++ freetype-2.3.11/src/truetype/ttgxvar.c 2010-10-22 08:52:37.000000000 +0200
-@@ -157,7 +157,7 @@
- runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;
- first = points[i++] = FT_GET_USHORT();
-
-- if ( runcnt < 1 )
-+ if ( runcnt < 1 || i + runcnt >= n )
- goto Exit;
-
- /* first point not included in runcount */
-@@ -168,7 +168,7 @@
- {
- first = points[i++] = FT_GET_BYTE();
-
-- if ( runcnt < 1 )
-+ if ( runcnt < 1 || i + runcnt >= n )
- goto Exit;
-
- for ( j = 0; j < runcnt; ++j )
+++ /dev/null
---- freetype-2.3.11/src/psaux/t1decode.c 2009-09-29 19:51:31.000000000 +0200
-+++ freetype-2.3.11/src/psaux/t1decode.c 2011-07-20 14:39:24.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* PostScript Type 1 decoding routines (body). */
- /* */
--/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
-+/* Copyright 2000-2011 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -27,6 +27,8 @@
-
- #include "psauxerr.h"
-
-+/* ensure proper sign extension */
-+#define Fix2Int( f ) ( (FT_Int)(FT_Short)( (f) >> 16 ) )
-
- /*************************************************************************/
- /* */
-@@ -665,7 +667,7 @@
- if ( large_int )
- FT_TRACE4(( " %ld", value ));
- else
-- FT_TRACE4(( " %ld", (FT_Int32)( value >> 16 ) ));
-+ FT_TRACE4(( " %ld", Fix2Int( value ) ));
- #endif
-
- *top++ = value;
-@@ -687,8 +689,8 @@
-
- top -= 2;
-
-- subr_no = (FT_Int)( top[1] >> 16 );
-- arg_cnt = (FT_Int)( top[0] >> 16 );
-+ subr_no = Fix2Int( top[1] );
-+ arg_cnt = Fix2Int( top[0] );
-
- /***********************************************************/
- /* */
-@@ -861,7 +863,7 @@
- if ( arg_cnt != 1 || blend == NULL )
- goto Unexpected_OtherSubr;
-
-- idx = (FT_Int)( top[0] >> 16 );
-+ idx = Fix2Int( top[0] );
-
- if ( idx < 0 ||
- idx + blend->num_designs > decoder->len_buildchar )
-@@ -929,7 +931,7 @@
- if ( arg_cnt != 2 || blend == NULL )
- goto Unexpected_OtherSubr;
-
-- idx = (FT_Int)( top[1] >> 16 );
-+ idx = Fix2Int( top[1] );
-
- if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
- goto Unexpected_OtherSubr;
-@@ -950,7 +952,7 @@
- if ( arg_cnt != 1 || blend == NULL )
- goto Unexpected_OtherSubr;
-
-- idx = (FT_Int)( top[0] >> 16 );
-+ idx = Fix2Int( top[0] );
-
- if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
- goto Unexpected_OtherSubr;
-@@ -1008,11 +1010,15 @@
- break;
-
- default:
-- FT_ERROR(( "t1_decoder_parse_charstrings:"
-- " unknown othersubr [%d %d], wish me luck\n",
-- arg_cnt, subr_no ));
-- unknown_othersubr_result_cnt = arg_cnt;
-- break;
-+ if ( arg_cnt >= 0 && subr_no >= 0 )
-+ {
-+ FT_ERROR(( "t1_decoder_parse_charstrings:"
-+ " unknown othersubr [%d %d], wish me luck\n",
-+ arg_cnt, subr_no ));
-+ unknown_othersubr_result_cnt = arg_cnt;
-+ break;
-+ }
-+ /* fall through */
-
- Unexpected_OtherSubr:
- FT_ERROR(( "t1_decoder_parse_charstrings:"
-@@ -1138,8 +1144,8 @@
- top[0],
- top[1],
- top[2],
-- (FT_Int)( top[3] >> 16 ),
-- (FT_Int)( top[4] >> 16 ) );
-+ Fix2Int( top[3] ),
-+ Fix2Int( top[4] ) );
-
- case op_sbw:
- FT_TRACE4(( " sbw" ));
-@@ -1313,7 +1319,7 @@
-
- FT_TRACE4(( " callsubr" ));
-
-- idx = (FT_Int)( top[0] >> 16 );
-+ idx = Fix2Int( top[0] );
- if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
- {
- FT_ERROR(( "t1_decoder_parse_charstrings:"
+++ /dev/null
---- freetype-2.3.11/src/base/ftbitmap.c 2009-07-31 18:45:18.000000000 +0200
-+++ freetype-2.3.11/src/base/ftbitmap.c 2011-10-19 12:25:26.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* FreeType utility functions for bitmaps (body). */
- /* */
--/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
-+/* Copyright 2004-2009, 2011 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -417,6 +417,10 @@
-
- target->pitch = source->width + pad;
-
-+ if ( target->pitch > 0 &&
-+ target->rows > FT_ULONG_MAX / target->pitch )
-+ return FT_Err_Invalid_Argument;
-+
- if ( target->rows * target->pitch > old_size &&
- FT_QREALLOC( target->buffer,
- old_size, target->rows * target->pitch ) )
---- freetype-2.3.11/src/psaux/t1decode.c 2011-10-19 12:25:26.000000000 +0200
-+++ freetype-2.3.11/src/psaux/t1decode.c 2011-10-19 12:25:26.000000000 +0200
-@@ -748,6 +748,13 @@
- if ( arg_cnt != 0 )
- goto Unexpected_OtherSubr;
-
-+ if ( decoder->flex_state == 0 )
-+ {
-+ FT_ERROR(( "t1_decoder_parse_charstrings:"
-+ " missing flex start\n" ));
-+ goto Syntax_Error;
-+ }
-+
- /* note that we should not add a point for index 0; */
- /* this will move our current position to the flex */
- /* point without adding any point to the outline */
---- freetype-2.3.11/src/raster/ftrend1.c 2009-07-03 15:28:24.000000000 +0200
-+++ freetype-2.3.11/src/raster/ftrend1.c 2011-10-19 13:26:02.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* The FreeType glyph rasterizer interface (body). */
- /* */
--/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */
-+/* Copyright 1996-2003, 2005, 2006, 2011 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -25,6 +25,7 @@
-
- #include "rasterrs.h"
-
-+#define FT_USHORT_MAX USHRT_MAX
-
- /* initialize renderer -- init its raster */
- static FT_Error
-@@ -168,6 +169,13 @@
-
- width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
- height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
-+
-+ if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )
-+ {
-+ error = Raster_Err_Invalid_Argument;
-+ goto Exit;
-+ }
-+
- bitmap = &slot->bitmap;
- memory = render->root.memory;
-
---- freetype-2.3.11/src/truetype/ttgxvar.c 2011-10-19 12:25:26.000000000 +0200
-+++ freetype-2.3.11/src/truetype/ttgxvar.c 2011-10-19 12:25:26.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* TrueType GX Font Variation loader */
- /* */
--/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
-+/* Copyright 2004-2011 by */
- /* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -1473,6 +1473,9 @@
- {
- for ( j = 0; j < point_count; ++j )
- {
-+ if ( localpoints[j] >= n_points )
-+ continue;
-+
- delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply );
- delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply );
- }
+++ /dev/null
---- freetype-2.3.11/src/cid/cidload.c 2009-07-03 15:28:24.000000000 +0200
-+++ freetype-2.3.11/src/cid/cidload.c 2011-11-15 12:58:41.000000000 +0100
-@@ -4,7 +4,7 @@
- /* */
- /* CID-keyed Type1 font loader (body). */
- /* */
--/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */
-+/* Copyright 1996-2006, 2009, 2011 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -110,7 +110,7 @@
- CID_FaceDict dict;
-
-
-- if ( parser->num_dict < 0 )
-+ if ( parser->num_dict < 0 || parser->num_dict >= cid->num_dicts )
- {
- FT_ERROR(( "cid_load_keyword: invalid use of `%s'\n",
- keyword->ident ));
-@@ -158,7 +158,7 @@
- FT_Fixed temp_scale;
-
-
-- if ( parser->num_dict >= 0 )
-+ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
- {
- dict = face->cid.font_dicts + parser->num_dict;
- matrix = &dict->font_matrix;
-@@ -249,7 +249,7 @@
- CID_FaceDict dict;
-
-
-- if ( parser->num_dict >= 0 )
-+ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
- {
- dict = face->cid.font_dicts + parser->num_dict;
-
-@@ -413,12 +413,25 @@
- FT_Byte* p;
-
-
-+ /* Check for possible overflow. */
-+ if ( num_subrs == FT_UINT_MAX )
-+ {
-+ error = CID_Err_Syntax_Error;
-+ goto Fail;
-+ }
-+
- /* reallocate offsets array if needed */
- if ( num_subrs + 1 > max_offsets )
- {
- FT_UInt new_max = FT_PAD_CEIL( num_subrs + 1, 4 );
-
-
-+ if ( new_max <= max_offsets )
-+ {
-+ error = CID_Err_Syntax_Error;
-+ goto Fail;
-+ }
-+
- if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) )
- goto Fail;
-
-@@ -436,6 +449,11 @@
-
- FT_FRAME_EXIT();
-
-+ /* offsets must be ordered */
-+ for ( count = 1; count <= num_subrs; count++ )
-+ if ( offsets[count - 1] > offsets[count] )
-+ goto Fail;
-+
- /* now, compute the size of subrs charstrings, */
- /* allocate, and read them */
- data_len = offsets[num_subrs] - offsets[0];
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2009-09-12 23:14:25.000000000 +0200
-+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:19:23.000000000 +0200
-@@ -1,6 +1,6 @@
- /*
- * Copyright 2000 Computing Research Labs, New Mexico State University
-- * Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
-+ * Copyright 2001-2012
- * Francesco Zappa Nardelli
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
-@@ -1235,7 +1235,8 @@
- ep = line + linelen;
-
- /* Trim the leading whitespace if it exists. */
-- *sp++ = 0;
-+ if ( *sp )
-+ *sp++ = 0;
- while ( *sp &&
- ( *sp == ' ' || *sp == '\t' ) )
- sp++;
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:20:31.000000000 +0200
-+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:22:28.000000000 +0200
-@@ -1092,6 +1092,7 @@
- #define ACMSG13 "Glyph %ld extra rows removed.\n"
- #define ACMSG14 "Glyph %ld extra columns removed.\n"
- #define ACMSG15 "Incorrect glyph count: %ld indicated but %ld found.\n"
-+#define ACMSG16 "Glyph %ld missing columns padded with zero bits.\n"
-
- /* Error messages. */
- #define ERRMSG1 "[line %ld] Missing \"%s\" line.\n"
-@@ -1695,18 +1696,31 @@
- for ( i = 0; i < nibbles; i++ )
- {
- c = line[i];
-+ if ( !c )
-+ break;
- *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );
- if ( i + 1 < nibbles && ( i & 1 ) )
- *++bp = 0;
- }
-
-+ /* If any line has not enough columns, */
-+ /* indicate they have been padded with zero bits. */
-+ if ( i < nibbles &&
-+ !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
-+ {
-+ FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG16, glyph->encoding ));
-+ p->flags |= _BDF_GLYPH_WIDTH_CHECK;
-+ font->modified = 1;
-+ }
-+
- /* Remove possible garbage at the right. */
- mask_index = ( glyph->bbx.width * p->font->bpp ) & 7;
- if ( glyph->bbx.width )
- *bp &= nibble_mask[mask_index];
-
- /* If any line has extra columns, indicate they have been removed. */
-- if ( ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) &&
-+ if ( i == nibbles &&
-+ ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) &&
- !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
- {
- FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
+++ /dev/null
---- freetype-2.3.11/src/pcf/pcfread.c 2009-10-10 19:32:28.000000000 +0200
-+++ freetype-2.3.11/src/pcf/pcfread.c 2012-03-28 10:29:54.000000000 +0200
-@@ -2,7 +2,7 @@
-
- FreeType font driver for pcf fonts
-
-- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by
-+ Copyright 2000-2010, 2012 by
- Francesco Zappa Nardelli
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
-@@ -495,7 +495,8 @@ THE SOFTWARE.
- goto Bail;
- }
-
-- if ( FT_NEW_ARRAY( strings, string_size ) )
-+ /* allocate one more byte so that we have a final null byte */
-+ if ( FT_NEW_ARRAY( strings, string_size + 1 ) )
- goto Bail;
-
- error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size );
+++ /dev/null
---- freetype-2.3.11/src/smooth/ftsmooth.c 2012-03-28 10:30:52.000000000 +0200
-+++ freetype-2.3.11/src/smooth/ftsmooth.c 2012-03-28 10:33:13.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* Anti-aliasing renderer interface (body). */
- /* */
--/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */
-+/* Copyright 2000-2006, 2009-2012 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -105,7 +105,7 @@
- FT_Error error;
- FT_Outline* outline = NULL;
- FT_BBox cbox;
-- FT_UInt width, height, height_org, width_org, pitch;
-+ FT_Pos width, height, height_org, width_org, pitch;
- FT_Bitmap* bitmap;
- FT_Memory memory;
- FT_Int hmul = mode == FT_RENDER_MODE_LCD;
-@@ -140,8 +140,8 @@
- cbox.xMax = FT_PIX_CEIL( cbox.xMax );
- cbox.yMax = FT_PIX_CEIL( cbox.yMax );
-
-- width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
-- height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
-+ width = ( cbox.xMax - cbox.xMin ) >> 6;
-+ height = ( cbox.yMax - cbox.yMin ) >> 6;
- bitmap = &slot->bitmap;
- memory = render->root.memory;
-
-@@ -200,7 +200,7 @@
-
- /* Required check is ( pitch * height < FT_ULONG_MAX ), */
- /* but we care realistic cases only. Always pitch <= width. */
-- if ( width > 0x7FFFU || height > 0x7FFFU )
-+ if ( width > 0x7FFF || height > 0x7FFF )
- {
- FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n",
- width, height ));
+++ /dev/null
---- freetype-2.3.11/src/psaux/psobjs.c 2009-07-31 18:45:18.000000000 +0200
-+++ freetype-2.3.11/src/psaux/psobjs.c 2012-04-03 13:14:05.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* Auxiliary functions for PostScript fonts (body). */
- /* */
--/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
-+/* Copyright 1996-2012 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -589,7 +589,7 @@
- }
-
- Exit:
-- if ( cur == parser->cursor )
-+ if ( cur < limit && cur == parser->cursor )
- {
- FT_ERROR(( "ps_parser_skip_PS_token:"
- " current token is `%c' which is self-delimiting\n"
---- freetype-2.3.11/src/type1/t1load.c 2009-09-01 08:07:32.000000000 +0200
-+++ freetype-2.3.11/src/type1/t1load.c 2012-04-03 13:14:30.000000000 +0200
-@@ -71,6 +71,13 @@
- #include "t1errors.h"
-
-
-+#ifdef FT_CONFIG_OPTION_INCREMENTAL
-+#define IS_INCREMENTAL ( face->root.internal->incremental_interface != 0 )
-+#else
-+#define IS_INCREMENTAL 0
-+#endif
-+
-+
- /*************************************************************************/
- /* */
- /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
-@@ -1027,7 +1034,8 @@
- static int
- read_binary_data( T1_Parser parser,
- FT_Long* size,
-- FT_Byte** base )
-+ FT_Byte** base,
-+ FT_Bool incremental )
- {
- FT_Byte* cur;
- FT_Byte* limit = parser->root.limit;
-@@ -1057,8 +1065,12 @@
- return !parser->root.error;
- }
-
-- FT_ERROR(( "read_binary_data: invalid size field\n" ));
-- parser->root.error = T1_Err_Invalid_File_Format;
-+ if( !incremental )
-+ {
-+ FT_ERROR(( "read_binary_data: invalid size field\n" ));
-+ parser->root.error = T1_Err_Invalid_File_Format;
-+ }
-+
- return 0;
- }
-
-@@ -1379,15 +1391,17 @@
- FT_Byte* base;
-
-
-- /* If the next token isn't `dup' we are done. */
-- if ( ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
-+ /* If we are out of data, or if the next token isn't `dup', */
-+ /* we are done. */
-+ if ( parser->root.cursor + 4 >= parser->root.limit ||
-+ ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
- break;
-
- T1_Skip_PS_Token( parser ); /* `dup' */
-
- idx = T1_ToInt( parser );
-
-- if ( !read_binary_data( parser, &size, &base ) )
-+ if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
- return;
-
- /* The binary string is followed by one token, e.g. `NP' */
-@@ -1399,7 +1413,8 @@
- return;
- T1_Skip_Spaces ( parser );
-
-- if ( ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 )
-+ if ( parser->root.cursor + 4 < parser->root.limit &&
-+ ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 )
- {
- T1_Skip_PS_Token( parser ); /* skip `put' */
- T1_Skip_Spaces ( parser );
-@@ -1572,7 +1587,7 @@
- cur++; /* skip `/' */
- len = parser->root.cursor - cur;
-
-- if ( !read_binary_data( parser, &size, &base ) )
-+ if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
- return;
-
- /* for some non-standard fonts like `Optima' which provides */
-@@ -1861,7 +1876,7 @@
-
-
- parser->root.cursor = start_binary;
-- if ( !read_binary_data( parser, &s, &b ) )
-+ if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
- return T1_Err_Invalid_File_Format;
- have_integer = 0;
- }
-@@ -1874,7 +1889,7 @@
-
-
- parser->root.cursor = start_binary;
-- if ( !read_binary_data( parser, &s, &b ) )
-+ if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
- return T1_Err_Invalid_File_Format;
- have_integer = 0;
- }
-@@ -2148,9 +2163,7 @@
- type1->subrs_len = loader.subrs.lengths;
- }
-
--#ifdef FT_CONFIG_OPTION_INCREMENTAL
-- if ( !face->root.internal->incremental_interface )
--#endif
-+ if ( !IS_INCREMENTAL )
- if ( !loader.charstrings.init )
- {
- FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" ));
+++ /dev/null
---- freetype-2.3.11/src/type1/t1parse.c 2009-07-03 15:28:24.000000000 +0200
-+++ freetype-2.3.11/src/type1/t1parse.c 2012-03-28 10:39:25.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* Type 1 parser (body). */
- /* */
--/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */
-+/* Copyright 1996-2005, 2008, 2009, 2012 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -464,6 +464,14 @@
- /* we now decrypt the encoded binary private dictionary */
- psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U );
-
-+ if ( parser->private_len < 4 )
-+ {
-+ FT_ERROR(( "T1_Get_Private_Dict:"
-+ " invalid private dictionary section\n" ));
-+ error = T1_Err_Invalid_File_Format;
-+ goto Fail;
-+ }
-+
- /* replace the four random bytes at the beginning with whitespace */
- parser->private_dict[0] = ' ';
- parser->private_dict[1] = ' ';
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:40:25.000000000 +0200
-+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:44:30.000000000 +0200
-@@ -1736,12 +1736,7 @@
- if ( ft_memcmp( line, "SWIDTH", 6 ) == 0 )
- {
- if ( !( p->flags & _BDF_ENCODING ) )
-- {
-- /* Missing ENCODING field. */
-- FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" ));
-- error = BDF_Err_Missing_Encoding_Field;
-- goto Exit;
-- }
-+ goto Missing_Encoding;
-
- error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
- if ( error )
-@@ -1756,6 +1751,9 @@
- /* Expect the DWIDTH (scalable width) field next. */
- if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 )
- {
-+ if ( !( p->flags & _BDF_ENCODING ) )
-+ goto Missing_Encoding;
-+
- error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
- if ( error )
- goto Exit;
-@@ -1781,6 +1779,9 @@
- /* Expect the BBX field next. */
- if ( ft_memcmp( line, "BBX", 3 ) == 0 )
- {
-+ if ( !( p->flags & _BDF_ENCODING ) )
-+ goto Missing_Encoding;
-+
- error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
- if ( error )
- goto Exit;
-@@ -1880,6 +1881,12 @@
- }
-
- error = BDF_Err_Invalid_File_Format;
-+ goto Exit;
-+
-+ Missing_Encoding:
-+ /* Missing ENCODING field. */
-+ FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" ));
-+ error = BDF_Err_Missing_Encoding_Field;
-
- Exit:
- return error;
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:46:09.000000000 +0200
-+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:45:50.000000000 +0200
-@@ -424,7 +424,7 @@
- if ( num_items > list->size )
- {
- unsigned long oldsize = list->size; /* same as _bdf_list_t.size */
-- unsigned long newsize = oldsize + ( oldsize >> 1 ) + 4;
-+ unsigned long newsize = oldsize + ( oldsize >> 1 ) + 5;
- unsigned long bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) );
- FT_Memory memory = list->memory;
-
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:49:56.000000000 +0200
-+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:51:40.000000000 +0200
-@@ -785,7 +785,7 @@
- };
-
-
--#define isdigok( m, d ) (m[(d) >> 3] & ( 1 << ( (d) & 7 ) ) )
-+#define isdigok( m, d ) (m[(unsigned char)(d) >> 3] & ( 1 << ( (d) & 7 ) ) )
-
-
- /* Routine to convert an ASCII string into an unsigned long integer. */
-@@ -1696,7 +1696,7 @@
- for ( i = 0; i < nibbles; i++ )
- {
- c = line[i];
-- if ( !c )
-+ if ( !isdigok( hdigits, c ) )
- break;
- *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );
- if ( i + 1 < nibbles && ( i & 1 ) )
-@@ -1719,9 +1719,9 @@
- *bp &= nibble_mask[mask_index];
-
- /* If any line has extra columns, indicate they have been removed. */
-- if ( i == nibbles &&
-- ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) &&
-- !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
-+ if ( i == nibbles &&
-+ isdigok( hdigits, line[nibbles] ) &&
-+ !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
- {
- FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
- p->flags |= _BDF_GLYPH_WIDTH_CHECK;
+++ /dev/null
---- freetype-2.3.11/src/psaux/psconv.c 2009-07-31 18:45:18.000000000 +0200
-+++ freetype-2.3.11/src/psaux/psconv.c 2012-03-28 10:55:16.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* Some convenience conversions (body). */
- /* */
--/* Copyright 2006, 2008, 2009 by */
-+/* Copyright 2006, 2008, 2009, 2012 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -79,7 +79,7 @@
- FT_Bool sign = 0;
-
-
-- if ( p == limit || base < 2 || base > 36 )
-+ if ( p >= limit || base < 2 || base > 36 )
- return 0;
-
- if ( *p == '-' || *p == '+' )
-@@ -150,7 +150,7 @@
- FT_Bool sign = 0;
-
-
-- if ( p == limit )
-+ if ( p >= limit )
- return 0;
-
- if ( *p == '-' || *p == '+' )
-@@ -346,7 +346,11 @@
-
- #if 1
-
-- p = *cursor;
-+ p = *cursor;
-+
-+ if ( p >= limit )
-+ return 0;
-+
- if ( n > (FT_UInt)( limit - p ) )
- n = (FT_UInt)( limit - p );
-
-@@ -434,6 +438,10 @@
- #if 1
-
- p = *cursor;
-+
-+ if ( p >= limit )
-+ return 0;
-+
- if ( n > (FT_UInt)(limit - p) )
- n = (FT_UInt)(limit - p);
-
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 11:53:32.000000000 +0200
-+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 11:54:12.000000000 +0200
-@@ -520,6 +520,14 @@
-
- /* Initialize the list. */
- list->used = 0;
-+ if ( list->size )
-+ {
-+ list->field[0] = (char*)empty;
-+ list->field[1] = (char*)empty;
-+ list->field[2] = (char*)empty;
-+ list->field[3] = (char*)empty;
-+ list->field[4] = (char*)empty;
-+ }
-
- /* If the line is empty, then simply return. */
- if ( linelen == 0 || line[0] == 0 )
+++ /dev/null
---- freetype-2.3.11/src/winfonts/winfnt.c 2009-07-31 18:45:19.000000000 +0200
-+++ freetype-2.3.11/src/winfonts/winfnt.c 2012-03-28 11:57:05.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* FreeType font driver for Windows FNT/FON files */
- /* */
--/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */
-+/* Copyright 1996-2004, 2006-2012 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* Copyright 2003 Huw D M Davies for Codeweavers */
- /* Copyright 2007 Dmitry Timoshkov for Codeweavers */
-@@ -825,7 +825,14 @@
- root->charmap = root->charmaps[0];
- }
-
-- /* setup remaining flags */
-+ /* set up remaining flags */
-+
-+ if ( font->header.last_char < font->header.first_char )
-+ {
-+ FT_TRACE2(( "invalid number of glyphs\n" ));
-+ error = FNT_Err_Invalid_File_Format;
-+ goto Fail;
-+ }
-
- /* reserve one slot for the .notdef glyph at index 0 */
- root->num_glyphs = font->header.last_char -
+++ /dev/null
---- freetype-2.3.11/src/base/ftcalc.c 2009-07-31 18:45:18.000000000 +0200
-+++ freetype-2.3.11/src/base/ftcalc.c 2012-03-28 11:59:17.000000000 +0200
-@@ -4,7 +4,7 @@
- /* */
- /* Arithmetic computations (body). */
- /* */
--/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */
-+/* Copyright 1996-2006, 2008, 2012 by */
- /* David Turner, Robert Wilhelm, and Werner Lemberg. */
- /* */
- /* This file is part of the FreeType project, and may only be used, */
-@@ -307,7 +307,7 @@
- q <<= 1;
- r |= lo >> 31;
-
-- if ( r >= (FT_UInt32)y )
-+ if ( r >= y )
- {
- r -= y;
- q |= 1;
-@@ -373,7 +373,7 @@
- if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 )
- a = ( a * b + ( c >> 1 ) ) / c;
-
-- else if ( c > 0 )
-+ else if ( (FT_Int32)c > 0 )
- {
- FT_Int64 temp, temp2;
-
-@@ -412,7 +412,7 @@
- if ( a <= 46340L && b <= 46340L && c > 0 )
- a = a * b / c;
-
-- else if ( c > 0 )
-+ else if ( (FT_Int32)c > 0 )
- {
- FT_Int64 temp;
-
-@@ -544,7 +544,7 @@
- s = (FT_Int32)a; a = FT_ABS( a );
- s ^= (FT_Int32)b; b = FT_ABS( b );
-
-- if ( b == 0 )
-+ if ( (FT_UInt32)b == 0 )
- {
- /* check for division by 0 */
- q = (FT_UInt32)0x7FFFFFFFL;
-@@ -552,15 +552,16 @@
- else if ( ( a >> 16 ) == 0 )
- {
- /* compute result directly */
-- q = (FT_UInt32)( (a << 16) + (b >> 1) ) / (FT_UInt32)b;
-+ q = (FT_UInt32)( ( a << 16 ) + ( b >> 1 ) ) / (FT_UInt32)b;
- }
- else
- {
- /* we need more bits; we have to do it by hand */
- FT_Int64 temp, temp2;
-
-- temp.hi = (FT_Int32) (a >> 16);
-- temp.lo = (FT_UInt32)(a << 16);
-+
-+ temp.hi = (FT_Int32) ( a >> 16 );
-+ temp.lo = (FT_UInt32)( a << 16 );
- temp2.hi = 0;
- temp2.lo = (FT_UInt32)( b >> 1 );
- FT_Add64( &temp, &temp2, &temp );
+++ /dev/null
---- freetype-2.3.11/src/truetype/ttgload.c 2009-09-08 07:06:51.000000000 +0200
-+++ freetype-2.3.11/src/truetype/ttgload.c 2012-03-28 12:01:04.000000000 +0200
-@@ -267,14 +267,17 @@
- if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit )
- goto Invalid_Outline;
-
-- prev_cont = FT_NEXT_USHORT( p );
-+ prev_cont = FT_NEXT_SHORT( p );
-
- if ( n_contours > 0 )
- cont[0] = prev_cont;
-
-+ if ( prev_cont < 0 )
-+ goto Invalid_Outline;
-+
- for ( cont++; cont < cont_limit; cont++ )
- {
-- cont[0] = FT_NEXT_USHORT( p );
-+ cont[0] = FT_NEXT_SHORT( p );
- if ( cont[0] <= prev_cont )
- {
- /* unordered contours: this is invalid */
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2013-01-15 09:57:36.000000000 +0100
-+++ freetype-2.3.11/src/bdf/bdflib.c 2013-01-15 10:04:37.000000000 +0100
-@@ -1588,9 +1588,11 @@
-
- p->glyph_enc = _bdf_atol( p->list.field[1], 0, 10 );
-
-- /* Check that the encoding is in the range [0,65536] because */
-- /* otherwise p->have (a bitmap with static size) overflows. */
-- if ( (size_t)p->glyph_enc >= sizeof ( p->have ) * 8 )
-+ /* Check that the encoding is in the Unicode range because */
-+ /* otherwise p->have (a bitmap with static size) overflows. */
-+ if ( p->glyph_enc > 0 &&
-+ (size_t)p->glyph_enc >= sizeof ( p->have ) /
-+ sizeof ( unsigned long ) * 32 )
- {
- error = BDF_Err_Invalid_File_Format;
- goto Exit;
+++ /dev/null
---- freetype-2.3.11/src/base/ftoutln.c 2009-03-14 14:45:26.000000000 +0100
-+++ freetype-2.3.11/src/base/ftoutln.c 2012-04-03 11:03:35.000000000 +0200
-@@ -990,7 +990,8 @@
-
- int i;
- FT_Pos ray_y[3];
-- FT_Orientation result[3];
-+ FT_Orientation result[3] =
-+ { FT_ORIENTATION_NONE, FT_ORIENTATION_NONE, FT_ORIENTATION_NONE };
-
-
- if ( !outline || outline->n_points <= 0 )
+++ /dev/null
---- freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2010-07-22 19:11:50.000000000 +0200
-+++ freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2010-07-22 19:12:41.000000000 +0200
-@@ -813,13 +813,13 @@
-
- for ( n = 0; n < (int)multimaster->num_axis; n++ )
- {
-- char temp[32];
-+ char temp[100];
-
-
-- sprintf( temp, " %s:%g",
-+ sprintf( temp, " %.50s:%g",
- multimaster->axis[n].name,
-- design_pos[n]/65536. );
-- strcat( Header, temp );
-+ design_pos[n] / 65536.0 );
-+ strncat( Header, temp, sizeof( Header ) - strlen( Header ) - 1 );
- }
- }
- grWriteCellString( &bit, 0, 16, Header, fore_color );
+++ /dev/null
---- freetype-2.3.11/src/bdf/bdflib.c 2012-04-02 16:24:56.000000000 +0200
-+++ freetype-2.3.11/src/bdf/bdflib.c 2012-04-02 16:25:33.000000000 +0200
-@@ -1870,7 +1870,7 @@
- glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;
-
- bitmap_size = glyph->bpr * glyph->bbx.height;
-- if ( bitmap_size > 0xFFFFU )
-+ if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU )
- {
- FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno ));
- error = BDF_Err_Bbx_Too_Big;
+++ /dev/null
-diff -up freetype-2.3.11/ft2demos-2.3.11/Makefile.more-demos freetype-2.3.11/ft2demos-2.3.11/Makefile
---- freetype-2.3.11/ft2demos-2.3.11/Makefile.more-demos 2009-10-22 16:02:26.000000000 -0400
-+++ freetype-2.3.11/ft2demos-2.3.11/Makefile 2009-10-22 16:02:32.000000000 -0400
-@@ -288,10 +288,10 @@ else
- # Note that ttdebug only works if the FreeType's `truetype' driver has
- # been compiled with TT_CONFIG_OPTION_BYTECODE_INTERPRETER defined.
- #
-- # EXES += ftchkwd
-- # EXES += ftmemchk
-- # EXES += ftpatchk
-- # EXES += fttimer
-+ EXES += ftchkwd
-+ EXES += ftmemchk
-+ EXES += ftpatchk
-+ EXES += fttimer
- # EXES += testname
- # EXES += ttdebug
-
+++ /dev/null
---- freetype-2.2.1/builds/unix/freetype-config.in.multilib 2006-07-27 18:50:40.000000000 -0400
-+++ freetype-2.2.1/builds/unix/freetype-config.in 2006-07-27 18:58:13.000000000 -0400
-@@ -9,11 +9,11 @@
- # indicate that you have read the license and understand and accept it
- # fully.
-
--prefix=@prefix@
--exec_prefix=@exec_prefix@
-+prefix=`pkg-config --variable prefix freetype2`
-+exec_prefix=`pkg-config --variable exec_prefix freetype2`
- exec_prefix_set=no
--includedir=@includedir@
--libdir=@libdir@
-+includedir=`pkg-config --variable includedir freetype2`
-+libdir=`pkg-config --variable libdir freetype2`
- enable_shared=@build_libtool_libs@
- wl=@wl@
- hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@'
+++ /dev/null
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-
-Name: pthread stubs
-Description: Stubs missing from libc for standard pthread functions
-Version: 0.1
-Libs:
+++ /dev/null
-From 2b76d028b0253be7c4496840fcd2e0fb47c0794e Mon Sep 17 00:00:00 2001
-From: Pierre Ossman <ossman@cendio.se>
-Date: Mon, 15 Dec 2014 10:52:43 +0100
-Subject: [PATCH] Band aid to work around inluding C headers in C++ code
-
----
- unix/xserver/hw/vnc/Makefile.am | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am
-index 9885b8a..372a57f 100644
---- a/unix/xserver/hw/vnc/Makefile.am
-+++ b/unix/xserver/hw/vnc/Makefile.am
-@@ -7,6 +7,9 @@ NETWORK_LIB=$(LIB_DIR)/network/libnetwork.la
- XREGION_LIB=$(LIB_DIR)/Xregion/libXregion.la
- COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB)
-
-+# Hack to get the C headers to work when included from C++ code
-+AM_CXXFLAGS = -fpermissive
-+
- noinst_LTLIBRARIES = libvnccommon.la
-
- HDRS = RegionHelper.h vncExtInit.h vncHooks.h XserverDesktop.h xorg-version.h \
+++ /dev/null
-From 0acffdd6f443198378012405e7f814f5abf278b3 Mon Sep 17 00:00:00 2001
-From: Adam Tkac <atkac@redhat.com>
-Date: Wed, 15 Sep 2010 15:37:01 +0200
-Subject: [PATCH] Add -dridir parameter to specify DRI drivers directory from command line.
-
-Signed-off-by: Adam Tkac <atkac@redhat.com>
----
- glx/glxdri.c | 2 --
- glx/glxdri2.c | 2 --
- glx/glxdriswrast.c | 2 --
- glx/glxext.c | 27 +++++++++++++++++++++++++++
- glx/glxserver.h | 3 +++
- os/utils.c | 9 +++++++++
- 6 files changed, 39 insertions(+), 6 deletions(-)
-
-diff --git a/glx/glxext.c b/glx/glxext.c
-index 89e58b0..5e7cf23 100644
---- a/glx/glxext.c
-+++ b/glx/glxext.c
-@@ -608,3 +608,30 @@ static int __glXDispatch(ClientPtr client)
-
- return retval;
- }
-+
-+char *dri_driver_path = DRI_DRIVER_PATH;
-+
-+int GlxProcessArguments(int argc, char *argv[], int i)
-+{
-+ if (strncmp(argv[i], "-dridir", 7) == 0) {
-+ if (++i < argc) {
-+#if !defined(WIN32) && !defined(__CYGWIN__)
-+ if (getuid() != geteuid()) {
-+ LogMessage(X_WARNING, "-dridir is not available for setuid X servers\n");
-+ return -1;
-+ } else
-+#endif
-+ {
-+ if (strlen(argv[i]) < PATH_MAX) {
-+ dri_driver_path = argv[i];
-+ return 2;
-+ } else {
-+ LogMessage(X_ERROR, "-dridir pathname too long\n");
-+ return -1;
-+ }
-+ }
-+ }
-+ }
-+
-+ return 0;
-+}
-diff --git a/glx/glxserver.h b/glx/glxserver.h
-index 1daf977..082ff82 100644
---- a/glx/glxserver.h
-+++ b/glx/glxserver.h
-@@ -251,4 +251,7 @@ extern unsigned glxMinorVersion;
-
- extern int __glXEventBase;
-
-+extern char *dri_driver_path;
-+extern int GlxProcessArguments(int argc, char *argv[], int i);
-+
- #endif /* !__GLX_server_h__ */
-diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
---- a/glx/glxdricommon.c
-+++ b/glx/glxdricommon.c
-@@ -209,6 +209,4 @@
- return head.next;
- }
-
--static const char dri_driver_path[] = DRI_DRIVER_PATH;
--
- void *
- glxProbeDriver(const char *driverName,
-diff --git a/os/utils.c b/os/utils.c
-index 13d3b3f..ff97c86 100644
---- a/os/utils.c
-+++ b/os/utils.c
-@@ -139,6 +139,7 @@ Bool noDPMSExtension = FALSE;
- #ifdef GLXEXT
- Bool noGlxExtension = FALSE;
- Bool noGlxVisualInit = FALSE;
-+extern int GlxProcessArguments(int argc, char *argv[], int i);
- #endif
- #ifdef SCREENSAVER
- Bool noScreenSaverExtension = FALSE;
-@@ -704,6 +705,14 @@ ProcessCommandLine(int argc, char *argv[])
- else
- UseMsg();
- }
-+#ifdef GLXEXT
-+ else if ((skip = GlxProcessArguments(argc,argv,i)) != 0) {
-+ if (skip > 0)
-+ i += skip - 1;
-+ else
-+ UseMsg();
-+ }
-+#endif
- #ifdef RLIMIT_DATA
- else if (strcmp(argv[i], "-ld") == 0) {
- if (++i < argc) {
---
-1.7.3.2
-
+++ /dev/null
-From 5e6e99eaef3ca346c78a3e520ed58ec8b8100b41 Mon Sep 17 00:00:00 2001
-From: Adam Tkac <atkac@redhat.com>
-Date: Thu, 2 Sep 2010 17:24:38 +0200
-Subject: [PATCH] Add -xkbcompdir parameter to modify "xkbcomp" path from commandline.
-
-Signed-off-by: Adam Tkac <atkac@redhat.com>
----
- xkb/xkbInit.c | 21 +++++++++++++++++++++
- 1 files changed, 21 insertions(+), 0 deletions(-)
-
-diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
-index fbf8f14..29fb33e 100644
---- a/xkb/xkbInit.c
-+++ b/xkb/xkbInit.c
-@@ -742,7 +742,28 @@ XkbProcessArguments(int argc,char *argv[],int i)
- }
- }
- return j;
-+ } else if (strncmp(argv[i], "-xkbcompdir", 11)==0) {
-+ if (++i < argc) {
-+#if !defined(WIN32) && !defined(__CYGWIN__)
-+ if (getuid() != geteuid()) {
-+ LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n");
-+ return -1;
-+ } else
-+#endif
-+ {
-+ if (strlen(argv[i]) < PATH_MAX) {
-+ XkbBinDirectory = argv[i];
-+ return 2;
-+ } else {
-+ LogMessage(X_ERROR, "-xkbcompdir pathname too long\n");
-+ return -1;
-+ }
-+ }
-+ } else {
-+ return -1;
-+ }
- }
-+
- if ((strcmp(argv[i], "-ardelay") == 0) || (strcmp(argv[i], "-ar1") == 0)) { /* -ardelay int */
- if (++i >= argc)
- UseMsg();
---
-1.7.2.3
-
+++ /dev/null
---- a/cmake/StaticBuild.cmake 2014-12-25 23:28:45.000000000 -0500
-+++ b/cmake/StaticBuild.cmake 2015-01-01 18:18:36.000000000 -0500
-@@ -82,10 +82,10 @@
- if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- set(FLTK_LIBRARIES "${FLTK_LIBRARIES} ${X11_Xcursor_LIB} ${X11_Xfixes_LIB} -Wl,-Bstatic -lXft -Wl,-Bdynamic -lfontconfig -lXext -R/usr/sfw/lib")
- else()
-- set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -Wl,-Bstatic -lXcursor -lXfixes -lXft -lfontconfig -lexpat -lfreetype -lbz2 -lXrender -lXext -lXinerama -Wl,-Bdynamic")
-+ set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -Wl,-Bstatic -lXft -lfontconfig -lfreetype -lXcursor -lXfixes -lz -lbz2 -lXrender -lXinerama -lXext -lexpat -Wl,-Bdynamic")
- endif()
-
-- set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -lX11")
-+ set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -Wl,-Bdynamic -lX11 -Wl,-Bstatic -lxcb -lXdmcp -lXau -lICE -Wl,-Bdynamic -ldl")
- endif()
- endif()
-
-@@ -93,7 +93,7 @@
- # them statically, even libXext. libX11 is somewhat stable, although
- # even it has had an ABI change once or twice.
- if(X11_FOUND AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
-- set(X11_LIBRARIES "-Wl,-Bstatic -lXext -Wl,-Bdynamic -lX11")
-+ set(X11_LIBRARIES "-Wl,-Bstatic -lXext -Wl,-Bdynamic -lX11 -Wl,-Bstatic -lxcb -lXdmcp -lXau -lICE -Wl,-Bdynamic -ldl -lpthread")
- if(X11_XTest_LIB)
- set(X11_XTest_LIB "-Wl,-Bstatic -lXtst -Wl,-Bdynamic")
- endif()
---- a/vncviewer/CMakeLists.txt 2014-11-04 21:38:36.000000000 -0500
-+++ b/vncviewer/CMakeLists.txt 2015-01-01 18:15:32.000000000 -0500
-@@ -46,7 +46,7 @@
- add_executable(vncviewer ${VNCVIEWER_SOURCES})
- endif()
-
--target_link_libraries(vncviewer rfb network rdr os Xregion ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES})
-+target_link_libraries(vncviewer ${FLTK_LIBRARIES} rfb network rdr os Xregion ${GETTEXT_LIBRARIES})
-
- if(APPLE)
- target_link_libraries(vncviewer "-framework Cocoa" "-framework Carbon")
+++ /dev/null
-#!/bin/bash
-#
-# Init file for TigerVNC Server
-#
-# Written by Dag Wieers <dag@wieers.com>
-#
-# chkconfig: - 91 35
-# description: TigerVNC remote X administration daemon.
-#
-# processname: Xvnc
-
-source /etc/rc.d/init.d/functions
-source /etc/sysconfig/network
-
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 1
-
-[ -x /usr/bin/Xvnc ] || exit 1
-
-### Default variables
-SYSCONFIG="/etc/sysconfig/vncservers"
-VNCSERVERS=""
-
-### Read configuration
-[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
-
-RETVAL=0
-prog="Xvnc"
-desc="TigerVNC remote administration daemon"
-
-start() {
- echo -n $"Starting $desc ($prog):"
- ulimit -S -c 0 &>/dev/null
- for display in ${VNCSERVERS}; do
- echo -n "${display} "
- unset BASH_ENV ENV
- initlog $INITLOG_ARGS -c \
- "su ${display##*:} -c \"cd ~${display##*:} && [ -f .vnc/passwd ] && vncserver :${display%:*} ${VNCSERVERARGS[${display%:*}]}\""
- RETVAL=$?
- [ "$RETVAL" -ne 0 ] && break
- done
- [ "$RETVAL" -eq 0 ] && success $"vncserver startup" || failure $"vncserver start"
- echo
- [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/$prog
- return $RETVAL
-}
-
-stop() {
- echo -n $"Shutting down $desc ($prog): "
- for display in ${VNCSERVERS}; do
- echo -n "${display} "
- unset BASH_ENV ENV
- initlog $INITLOG_ARGS -c \
- "su ${display##*:} -c \"vncserver -kill :${display%:*}\" &>/dev/null"
- done
- RETVAL=$?
- [ "$RETVAL" -eq 0 ] && success $"vncserver shutdown" || failure $"vncserver shutdown"
- echo
- [ "$RETVAL" -eq 0 ] && rm -f /var/lock/subsys/$prog
- return $RETVAL
-}
-
-restart() {
- stop
- start
-}
-
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart|reload)
- restart
- ;;
- condrestart)
- [ -e /var/lock/subsys/$prog ] && restart
- RETVAL=$?
- ;;
- status)
- status $prog
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|condrestart|status}"
- RETVAL=1
-esac
-
-exit $RETVAL
+++ /dev/null
-# The VNCSERVERS variable is a list of display:user pairs.
-#
-# Uncomment the lines below to start a VNC server on display :2
-# as my 'myusername' (adjust this to your own). You will also
-# need to set a VNC password; run 'man vncpasswd' to see how
-# to do that.
-#
-# DO NOT RUN THIS SERVICE if your local area network is
-# untrusted! For a secure way of using VNC, see this URL:
-# http://kbase.redhat.com/faq/docs/DOC-7028
-
-# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
-
-# Use "-localhost" to prevent remote VNC clients connecting except when
-# doing so through a secure tunnel. See the "-via" option in the
-# `man vncviewer' manual page.
-
-# VNCSERVERS="2:myusername"
-# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
+++ /dev/null
-%define _default_patch_fuzz 2
-%define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}
-%{!?_self_signed: %define _self_signed 1}
-%{!?_bootstrap: %define _bootstrap 1}
-#%global scl_name %{name}$(echo %version | sed -e 's/\\.//;s/\\..*//')
-%define scl_name %{name}16
-%if %{_bootstrap}
-%define xorg_buildroot $RPM_BUILD_ROOT/opt/%{name}/%{scl_name}
-%else
-%define xorg_buildroot /opt/%{name}/%{scl_name}
-%endif
-
-Name: tigervnc
-Version: @VERSION@
-Release: 3%{?snap:.%{snap}}%{?dist}
-Summary: A TigerVNC remote display system
-
-Group: User Interface/Desktops
-License: GPLv2+
-Packager: Brian P. Hinz <bphinz@users.sourceforge.net>
-URL: http://www.tigervnc.com
-
-Source0: %{name}-%{version}%{?snap:-%{snap}}.tar.bz2
-Source1: vncserver.service
-Source2: vncserver.sysconfig
-Source9: FindX11.cmake
-Source11: http://fltk.org/pub/fltk/1.3.3/fltk-1.3.3-source.tar.gz
-Source12: http://downloads.sourceforge.net/project/libjpeg-turbo/1.4.2/libjpeg-turbo-1.4.2.tar.gz
-Source13: http://downloads.sourceforge.net/project/libpng/libpng15/1.5.24/libpng-1.5.24.tar.bz2
-Source14: https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2
-Source15: http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.7.tar.gz
-Source16: https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz
-Source17: ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.19.tar.xz
-
-Source100: http://www.x.org/releases/X11R7.7/src/everything/bigreqsproto-1.1.2.tar.bz2
-Source101: http://www.x.org/releases/X11R7.7/src/everything/compositeproto-0.4.2.tar.bz2
-Source102: http://www.x.org/releases/X11R7.7/src/everything/damageproto-1.2.1.tar.bz2
-Source103: http://www.x.org/releases/X11R7.7/src/everything/dmxproto-2.3.1.tar.bz2
-Source104: http://www.x.org/releases/X11R7.7/src/everything/dri2proto-2.6.tar.bz2
-Source105: http://www.x.org/releases/X11R7.7/src/everything/fixesproto-5.0.tar.bz2
-Source106: http://www.x.org/releases/X11R7.7/src/everything/font-util-1.3.0.tar.bz2
-Source107: http://www.x.org/releases/X11R7.7/src/everything/fontsproto-2.1.2.tar.bz2
-Source108: http://www.x.org/releases/X11R7.7/src/everything/glproto-1.4.15.tar.bz2
-Source109: http://www.x.org/releases/X11R7.7/src/everything/inputproto-2.2.tar.bz2
-Source110: http://www.x.org/releases/X11R7.7/src/everything/kbproto-1.0.6.tar.bz2
-Source111: http://www.x.org/releases/X11R7.7/src/everything/libICE-1.0.8.tar.bz2
-Source112: http://www.x.org/releases/X11R7.7/src/everything/libSM-1.2.1.tar.bz2
-Source113: http://www.x.org/releases/X11R7.7/src/everything/libX11-1.5.0.tar.bz2
-Source114: http://www.x.org/releases/X11R7.7/src/everything/libXScrnSaver-1.2.2.tar.bz2
-Source115: http://www.x.org/releases/X11R7.7/src/everything/libXau-1.0.7.tar.bz2
-Source116: http://www.x.org/releases/X11R7.7/src/everything/libXaw-1.0.11.tar.bz2
-Source117: http://www.x.org/releases/X11R7.7/src/everything/libXcomposite-0.4.3.tar.bz2
-Source118: http://www.x.org/releases/X11R7.7/src/everything/libXcursor-1.1.13.tar.bz2
-Source119: http://www.x.org/releases/X11R7.7/src/everything/libXdamage-1.1.3.tar.bz2
-Source120: http://www.x.org/releases/X11R7.7/src/everything/libXdmcp-1.1.1.tar.bz2
-Source121: http://www.x.org/releases/X11R7.7/src/everything/libXext-1.3.1.tar.bz2
-Source122: http://www.x.org/releases/X11R7.7/src/everything/libXfixes-5.0.tar.bz2
-Source123: http://www.x.org/releases/X11R7.7/src/everything/libXfont-1.4.5.tar.bz2
-Source124: http://www.x.org/releases/X11R7.7/src/everything/libXft-2.3.1.tar.bz2
-Source125: http://www.x.org/releases/X11R7.7/src/everything/libXi-1.6.1.tar.bz2
-Source126: http://www.x.org/releases/X11R7.7/src/everything/libXinerama-1.1.2.tar.bz2
-Source127: http://www.x.org/releases/X11R7.7/src/everything/libXmu-1.1.1.tar.bz2
-Source128: http://www.x.org/releases/X11R7.7/src/everything/libXpm-3.5.10.tar.bz2
-Source129: http://www.x.org/releases/X11R7.7/src/everything/libXrandr-1.3.2.tar.bz2
-Source130: http://www.x.org/releases/X11R7.7/src/everything/libXrender-0.9.7.tar.bz2
-Source131: http://www.x.org/releases/X11R7.7/src/everything/libXres-1.0.6.tar.bz2
-Source132: http://www.x.org/releases/X11R7.7/src/everything/libXt-1.1.3.tar.bz2
-Source133: http://www.x.org/releases/X11R7.7/src/everything/libXtst-1.2.1.tar.bz2
-Source134: http://www.x.org/releases/X11R7.7/src/everything/libXv-1.0.7.tar.bz2
-Source135: http://www.x.org/releases/X11R7.7/src/everything/libXvMC-1.0.7.tar.bz2
-Source136: http://www.x.org/releases/X11R7.7/src/everything/libXxf86dga-1.1.3.tar.bz2
-Source137: http://www.x.org/releases/X11R7.7/src/everything/libXxf86vm-1.1.2.tar.bz2
-Source138: http://www.x.org/releases/X11R7.7/src/everything/libfontenc-1.1.1.tar.bz2
-Source139: http://www.x.org/releases/X11R7.7/src/everything/libpciaccess-0.13.1.tar.bz2
-#Source140: http://www.x.org/releases/X11R7.7/src/everything/libpthread-stubs-0.3.tar.bz2
-# libpthread-stubs fails to compile, so we use the same method
-# as the el6 libxcb rpm. pthread-stubs.pc.in taken from el6 libxcb rpm
-Source140: pthread-stubs.pc.in
-Source141: http://www.x.org/releases/X11R7.7/src/everything/libxcb-1.8.1.tar.bz2
-Source142: http://www.x.org/releases/X11R7.7/src/everything/libxkbfile-1.0.8.tar.bz2
-Source143: http://www.x.org/releases/X11R7.7/src/everything/makedepend-1.0.4.tar.bz2
-Source144: http://www.x.org/releases/X11R7.7/src/everything/randrproto-1.3.2.tar.bz2
-Source145: http://www.x.org/releases/X11R7.7/src/everything/recordproto-1.14.2.tar.bz2
-Source146: http://www.x.org/releases/X11R7.7/src/everything/renderproto-0.11.1.tar.bz2
-Source147: http://www.x.org/releases/X11R7.7/src/everything/resourceproto-1.2.0.tar.bz2
-Source148: http://www.x.org/releases/X11R7.7/src/everything/scrnsaverproto-1.2.2.tar.bz2
-Source149: http://www.x.org/releases/X11R7.7/src/everything/util-macros-1.17.tar.bz2
-Source150: http://www.x.org/releases/X11R7.7/src/everything/videoproto-2.3.1.tar.bz2
-Source151: http://www.x.org/releases/X11R7.7/src/everything/xcb-proto-1.7.1.tar.bz2
-Source152: http://www.x.org/releases/X11R7.7/src/everything/xcmiscproto-1.2.2.tar.bz2
-Source153: http://www.x.org/releases/X11R7.7/src/everything/xextproto-7.2.1.tar.bz2
-Source154: http://www.x.org/releases/X11R7.7/src/everything/xf86bigfontproto-1.2.0.tar.bz2
-Source155: http://www.x.org/releases/X11R7.7/src/everything/xf86dgaproto-2.1.tar.bz2
-Source156: http://www.x.org/releases/X11R7.7/src/everything/xf86driproto-2.1.1.tar.bz2
-Source157: http://www.x.org/releases/X11R7.7/src/everything/xf86vidmodeproto-2.3.1.tar.bz2
-Source158: http://www.x.org/releases/X11R7.7/src/everything/xineramaproto-1.2.1.tar.bz2
-Source159: http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2
-Source160: http://www.x.org/releases/X11R7.7/src/everything/xproto-7.0.23.tar.bz2
-Source161: http://www.x.org/releases/X11R7.7/src/everything/xrandr-1.3.5.tar.bz2
-Source162: http://www.x.org/releases/X11R7.7/src/everything/xtrans-1.2.7.tar.bz2
-
-Source200: http://fontconfig.org/release/fontconfig-2.8.0.tar.gz
-Source201: http://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.3.11.tar.bz2
-Source202: http://xorg.freedesktop.org/archive/individual/lib/pixman-0.32.4.tar.bz2
-Source203: http://dri.freedesktop.org/libdrm/libdrm-2.4.52.tar.bz2
-Source204: ftp://ftp.freedesktop.org/pub/mesa/older-versions/9.x/9.2.5/MesaLib-9.2.5.tar.bz2
-# NOTE:
-# libgcrypt from el5 is not new enough to satisfy newer Xorg requirements for --with-sha1,
-# which causes Xorg to link against libssl.so and introduce about 10 dynamic dependencies.
-# to prevent this, build a static libsha1 and link against that.
-# NOTE:
-Source205: https://github.com/dottedmag/libsha1/archive/0.3.tar.gz
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-# xorg requires newer versions of automake, & autoconf than are available with el5. Use el6 versions.
-BuildRequires: automake >= 1.11, autoconf >= 2.60, libtool >= 1.4, gettext >= 0.14.4, gettext-devel >= 0.14.4, bison-devel, python26
-BuildRequires: pam-devel
-BuildRequires: cmake28
-BuildRequires: pkgconfig >= 0.20
-BuildRequires: gcc44, gcc44-c++
-BuildRequires: glibc-devel, libstdc++-devel, libpng-devel
-BuildRequires: expat-devel
-BuildRequires: git, gperf, intltool, libtalloc-devel
-BuildRequires: kernel-headers, libatomic_ops-devel
-BuildRequires: xz
-%if !%{_bootstrap}
-BuildRequires: %{name}-static-devel == %{version}
-BuildRequires: nasm >= 2.01
-%endif
-
-Requires(post): initscripts chkconfig coreutils
-Requires(postun):coreutils
-Requires: hicolor-icon-theme
-Requires: tigervnc-license
-
-Provides: vnc = 4.1.3-2, vnc-libs = 4.1.3-2
-Obsoletes: vnc < 4.1.3-2, vnc-libs < 4.1.3-2
-Provides: tightvnc = 1.5.0-0.15.20090204svn3586
-Obsoletes: tightvnc < 1.5.0-0.15.20090204svn3586
-
-# tigervnc patches
-Patch12: tigervnc14-static-build-fixes.patch
-Patch13: tigervnc14-Add-dridir-param.patch
-Patch14: tigervnc14-Add-xkbcompdir-param.patch
-
-# fltk patches
-Patch15: fltk-1.3.3-static-libs.patch
-
-# freetype patches
-Patch20: freetype-2.1.10-enable-ft2-bci.patch
-Patch21: freetype-2.3.0-enable-spr.patch
-
-# Enable otvalid and gxvalid modules
-Patch46: freetype-2.2.1-enable-valid.patch
-
-# Fix multilib conflicts
-Patch88: freetype-multilib.patch
-
-Patch89: freetype-2.3.11-CVE-2010-2498.patch
-Patch90: freetype-2.3.11-CVE-2010-2499.patch
-Patch91: freetype-2.3.11-CVE-2010-2500.patch
-Patch92: freetype-2.3.11-CVE-2010-2519.patch
-Patch93: freetype-2.3.11-CVE-2010-2520.patch
-Patch96: freetype-2.3.11-CVE-2010-1797.patch
-Patch97: freetype-2.3.11-CVE-2010-2805.patch
-Patch98: freetype-2.3.11-CVE-2010-2806.patch
-Patch99: freetype-2.3.11-CVE-2010-2808.patch
-Patch100: freetype-2.3.11-CVE-2010-3311.patch
-Patch101: freetype-2.3.11-CVE-2010-3855.patch
-Patch102: freetype-2.3.11-CVE-2011-0226.patch
-Patch103: freetype-2.3.11-CVE-2011-3256.patch
-Patch104: freetype-2.3.11-CVE-2011-3439.patch
-Patch105: freetype-2.3.11-CVE-2012-1126.patch
-Patch106: freetype-2.3.11-CVE-2012-1127.patch
-Patch107: freetype-2.3.11-CVE-2012-1130.patch
-Patch108: freetype-2.3.11-CVE-2012-1131.patch
-Patch109: freetype-2.3.11-CVE-2012-1132.patch
-Patch110: freetype-2.3.11-CVE-2012-1134.patch
-Patch111: freetype-2.3.11-CVE-2012-1136.patch
-Patch112: freetype-2.3.11-CVE-2012-1137.patch
-Patch113: freetype-2.3.11-CVE-2012-1139.patch
-Patch114: freetype-2.3.11-CVE-2012-1140.patch
-Patch115: freetype-2.3.11-CVE-2012-1141.patch
-Patch116: freetype-2.3.11-CVE-2012-1142.patch
-Patch117: freetype-2.3.11-CVE-2012-1143.patch
-Patch118: freetype-2.3.11-CVE-2012-1144.patch
-Patch119: freetype-2.3.11-bdf-overflow.patch
-Patch120: freetype-2.3.11-array-initialization.patch
-Patch121: freetype-2.3.11-CVE-2012-5669.patch
-
-# Patches for Xorg CVE-2014-12-09 taken from Debian:
-# https://release.debian.org/proposed-updates/stable_diffs/xorg-server_1.12.4-6+deb7u5.debdiff
-Patch10000: 16_CVE-2014-mult.diff
-Patch10001: 17_CVE-regressions.diff
-# http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/
-Patch10002: CVE-2015-0255.diff
-# http://www.x.org/wiki/Development/Security/Advisory-2015-03-17/
-Patch10003: CVE-2015-1802.diff
-Patch10004: CVE-2015-1803.diff
-Patch10005: CVE-2015-1804.diff
-# http://lists.x.org/archives/xorg-announce/2015-April/002561.html
-Patch10006: CVE-2013-7439.diff
-
-%description
-Virtual Network Computing (VNC) is a remote display system which
-allows you to view a computing 'desktop' environment not only on the
-machine where it is running, but from anywhere on the Internet and
-from a wide variety of machine architectures. This package contains a
-client which will allow you to connect to other desktops running a VNC
-server.
-
-%package server
-Summary: A TigerVNC server
-Group: User Interface/X
-Provides: vnc-server = 4.1.3-2, vnc-libs = 4.1.3-2
-Obsoletes: vnc-server < 4.1.3-2, vnc-libs < 4.1.3-2
-Provides: tightvnc-server = 1.5.0-0.15.20090204svn3586
-Obsoletes: tightvnc-server < 1.5.0-0.15.20090204svn3586
-Requires: perl
-Requires: tigervnc-server-minimal
-Requires: xorg-x11-xauth
-
-%description server
-The VNC system allows you to access the same desktop from a wide
-variety of platforms. This package includes set of utilities
-which make usage of TigerVNC server more user friendly. It also
-contains x0vncserver program which can export your active
-X session.
-
-%package server-minimal
-Summary: A minimal installation of TigerVNC server
-Group: User Interface/X
-Requires(post): chkconfig
-Requires(preun):chkconfig
-Requires(preun):initscripts
-Requires(postun):initscripts
-
-Requires: xkeyboard-config, xorg-x11-xkb-utils
-Requires: keyutils-libs-devel
-Requires: tigervnc-license
-
-%description server-minimal
-The VNC system allows you to access the same desktop from a wide
-variety of platforms. This package contains minimal installation
-of TigerVNC server, allowing others to access the desktop on your
-machine.
-
-%package license
-Summary: License of TigerVNC suite
-Group: User Interface/X
-%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6 || 0%{?centos} >= 6
-BuildArch: noarch
-%endif
-
-%description license
-This package contains license of the TigerVNC suite
-
-%package icons
-Summary: Icons for TigerVNC viewer
-Group: User Interface/X
-%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6 || 0%{?centos} >= 6
-BuildArch: noarch
-%endif
-
-%description icons
-This package contains icons for TigerVNC viewer
-
-%if %{_bootstrap}
-%package static-devel
-Summary: Static development files necessary to build TigerVNC
-Group: Development/Libraries
-
-%description static-devel
-This package contains static development files necessary to build TigerVNC
-%endif
-
-%prep
-rm -rf $RPM_BUILD_ROOT
-rm -rf %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}
-%setup -q -n %{name}-%{version}%{?snap:-%{snap}}
-
-# Search paths for X11 are hard coded into FindX11.cmake
-cp %SOURCE9 cmake/Modules/
-sed -i -e "s#@_includedir@#%{xorg_buildroot}%{_includedir}#" cmake/Modules/FindX11.cmake
-sed -i -e "s#@_libdir@#%{xorg_buildroot}%{_libdir}#" cmake/Modules/FindX11.cmake
-%patch12 -p1 -b .static-build-fixes
-
-%if %{_bootstrap}
-tar xzf %SOURCE11
-pushd fltk-*
-%patch15 -p1 -b .static-libs
-popd
-
-tar xzf %SOURCE12
-tar xjf %SOURCE13
-tar xjf %SOURCE14
-tar xzf %SOURCE15
-tar xzf %SOURCE16
-xzcat %SOURCE17 | tar xf -
-%endif
-
-mkdir xorg
-pushd xorg
-%if %{_bootstrap}
-tar xjf %SOURCE100
-tar xjf %SOURCE101
-tar xjf %SOURCE102
-tar xjf %SOURCE103
-tar xjf %SOURCE104
-tar xjf %SOURCE105
-tar xjf %SOURCE106
-tar xjf %SOURCE107
-tar xjf %SOURCE108
-tar xjf %SOURCE109
-tar xjf %SOURCE110
-tar xjf %SOURCE111
-tar xjf %SOURCE112
-tar xjf %SOURCE113
-pushd libX11-*
-%patch10006 -p1 -b .CVE-2013-7439
-popd
-tar xjf %SOURCE114
-tar xjf %SOURCE115
-tar xjf %SOURCE116
-tar xjf %SOURCE117
-tar xjf %SOURCE118
-tar xjf %SOURCE119
-tar xjf %SOURCE120
-tar xjf %SOURCE121
-tar xjf %SOURCE122
-tar xjf %SOURCE123
-pushd libXfont-*
-%patch10003 -p1 -b .CVE-2015-1802
-%patch10004 -p1 -b .CVE-2015-1803
-%patch10005 -p1 -b .CVE-2015-1804
-popd
-tar xjf %SOURCE124
-tar xjf %SOURCE125
-tar xjf %SOURCE126
-tar xjf %SOURCE127
-tar xjf %SOURCE128
-tar xjf %SOURCE129
-tar xjf %SOURCE130
-tar xjf %SOURCE131
-tar xjf %SOURCE132
-tar xjf %SOURCE133
-tar xjf %SOURCE134
-tar xjf %SOURCE135
-tar xjf %SOURCE136
-tar xjf %SOURCE137
-tar xjf %SOURCE138
-tar xjf %SOURCE139
-
-tar xjf %SOURCE141
-tar xjf %SOURCE142
-tar xjf %SOURCE143
-tar xjf %SOURCE144
-tar xjf %SOURCE145
-tar xjf %SOURCE146
-tar xjf %SOURCE147
-tar xjf %SOURCE148
-tar xjf %SOURCE149
-tar xjf %SOURCE150
-tar xjf %SOURCE151
-tar xjf %SOURCE152
-tar xjf %SOURCE153
-tar xjf %SOURCE154
-tar xjf %SOURCE155
-tar xjf %SOURCE156
-tar xjf %SOURCE157
-tar xjf %SOURCE158
-%endif
-tar xjf %SOURCE159
-%if %{_bootstrap}
-tar xjf %SOURCE160
-tar xjf %SOURCE161
-tar xjf %SOURCE162
-tar xzf %SOURCE200
-tar xjf %SOURCE201
-pushd freetype-*
-%patch46 -p1 -b .enable-valid
-%patch88 -p1 -b .multilib
-%patch89 -p1 -b .CVE-2010-2498
-%patch90 -p1 -b .CVE-2010-2499
-%patch91 -p1 -b .CVE-2010-2500
-%patch92 -p1 -b .CVE-2010-2519
-%patch93 -p1 -b .CVE-2010-2520
-%patch96 -p1 -b .CVE-2010-1797
-%patch97 -p1 -b .CVE-2010-2805
-%patch98 -p1 -b .CVE-2010-2806
-%patch99 -p1 -b .CVE-2010-2808
-%patch100 -p1 -b .CVE-2010-3311
-%patch101 -p1 -b .CVE-2010-3855
-%patch102 -p1 -b .CVE-2011-0226
-%patch103 -p1 -b .CVE-2011-3256
-%patch104 -p1 -b .CVE-2011-3439
-%patch105 -p1 -b .CVE-2012-1126
-%patch106 -p1 -b .CVE-2012-1127
-%patch107 -p1 -b .CVE-2012-1130
-%patch108 -p1 -b .CVE-2012-1131
-%patch109 -p1 -b .CVE-2012-1132
-%patch110 -p1 -b .CVE-2012-1134
-%patch111 -p1 -b .CVE-2012-1136
-%patch112 -p1 -b .CVE-2012-1137
-%patch113 -p1 -b .CVE-2012-1139
-%patch114 -p1 -b .CVE-2012-1140
-%patch115 -p1 -b .CVE-2012-1141
-%patch116 -p1 -b .CVE-2012-1142
-%patch117 -p1 -b .CVE-2012-1143
-%patch118 -p1 -b .CVE-2012-1144
-%patch119 -p1 -b .bdf-overflow
-%patch120 -p1 -b .array-initialization
-%patch121 -p1 -b .CVE-2012-5669
-popd
-tar xjf %SOURCE202
-tar xjf %SOURCE203
-tar xjf %SOURCE204
-%endif
-pushd xorg-server-1*
-%patch10000 -p1 -b .CVE-2014-mult
-%patch10001 -p1 -b .CVE-regressions
-%patch10002 -p1 -b .CVE-2015-0255
-for f in `find . -type f -perm -000`; do
- chmod +r "$f"
-done
-popd
-%if %{_bootstrap}
-tar xzf %SOURCE205
-%endif
-popd
-
-cp -a xorg/xorg-server-1*/* unix/xserver
-
-pushd unix/xserver
-for all in `find . -type f -perm -001`; do
- chmod -x "$all"
-done
-patch -p1 < %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}/unix/xserver112.patch
-%patch13 -p1 -b .dridir
-%patch14 -p1 -b .xkbcompdir
-
-popd
-
-%build
-export CC=gcc44
-export CXX=g++44
-export CFLAGS="-g $RPM_OPT_FLAGS -fPIC"
-export CXXFLAGS="$CFLAGS -static-libgcc"
-export PYTHON=python26
-
-%if %{_bootstrap}
-mkdir -p %{xorg_buildroot}%{_libdir}
-pushd %{xorg_buildroot}%{_libdir}
-ln -s `g++44 -print-file-name=libz.a` .
-ln -s `g++44 -print-file-name=libgcc.a` .
-ln -s `g++44 -print-file-name=libexpat.a` .
-ln -s `g++44 -print-file-name=libcrypto.a` .
-popd
-
-echo "*** Building libjpeg-turbo ***"
-pushd libjpeg-turbo-*
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared
-make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
-popd
-
-echo "*** Building Xorg ***"
-pushd xorg
-
-echo "*** Building libsha1 ***"
-pushd libsha1-*
-autoreconf -fiv
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared
-make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-popd
-%endif
-
-export CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{xorg_buildroot}%{_includedir}"
-export CXXFLAGS="$RPM_OPT_FLAGS -fPIC -I%{xorg_buildroot}%{_includedir} -static-libgcc"
-export CPPFLAGS=$CXXFLAGS
-export LDFLAGS="-L%{xorg_buildroot}%{_libdir} -L%{xorg_buildroot}%{_libdir}/tigervnc $LDFLAGS"
-export ACLOCAL="aclocal -I %{xorg_buildroot}%{_datadir}/aclocal"
-export PKG_CONFIG_PATH="%{xorg_buildroot}%{_libdir}/pkgconfig:%{xorg_buildroot}%{_libdir}/tigervnc/pkgconfig:%{xorg_buildroot}%{_datadir}/pkgconfig:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig"
-
-%if %{_bootstrap}
-echo "*** Building gmp ***"
-pushd gmp-*
-%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=64 ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx
-%else
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=32 ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx
-%endif
-make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-
-echo "*** Building libtasn1 ***"
-pushd libtasn1-*
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
-make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-
-echo "*** Building nettle ***"
-pushd nettle-*
-autoreconf -fiv
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --disable-openssl
-make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-
-echo "*** Building gnutls ***"
-pushd gnutls-*
-LDFLAGS="-L%{xorg_buildroot}%{_libdir} -lgmp $LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure \
- --host=%{_host} \
- --build=%{_build} \
- --prefix=%{_prefix} \
- --libdir=%{_libdir} \
- --enable-static \
- --disable-shared \
- --without-p11-kit \
- --disable-guile \
- --disable-srp-authentication \
- --disable-libdane \
- --disable-doc \
- --enable-local-libopts \
- --without-tpm \
- --disable-dependency-tracking \
- --disable-silent-rules \
- --disable-heartbeat-support
-make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-
-pushd xorg
-
-echo "*** Building freetype ***"
-pushd freetype-*
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
-sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' builds/unix/libtool
-sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' builds/unix/libtool
-make DESTDIR=%{xorg_buildroot} install
-# FIXME: fontconfig bails out if we delete the libtool archives
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -exec sed -i -e "s|libdir='%{_libdir}'|libdir='%{xorg_buildroot}%{_libdir}'|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-# fix multilib issues
-%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
-%define wordsize 64
-%else
-%define wordsize 32
-%endif
-
-mv %{xorg_buildroot}%{_includedir}/freetype2/freetype/config/ftconfig.h \
- %{xorg_buildroot}%{_includedir}/freetype2/freetype/config/ftconfig-%{wordsize}.h
-cat >%{xorg_buildroot}%{_includedir}/freetype2/freetype/config/ftconfig.h <<EOF
-#ifndef __FTCONFIG_H__MULTILIB
-#define __FTCONFIG_H__MULTILIB
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 32
-# include "ftconfig-32.h"
-#elif __WORDSIZE == 64
-# include "ftconfig-64.h"
-#else
-# error "unexpected value for __WORDSIZE macro"
-#endif
-
-#endif
-EOF
-popd
-
-echo "*** Building fontconfig ***"
-pushd fontconfig-*
-autoreconf -fiv
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" HASDOCBOOK=no ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --with-confdir=%{_sysconfdir}/fonts --with-cache-dir=%{_localstatedir}/cache/fontconfig --with-default-fonts=%{_datadir}/fonts --with-add-fonts="%{_datadir}/X11/fonts/Type1,%{_datadir}/X11/fonts/OTF,%{_datadir}/X11/fonts/TTF,%{_datadir}/X11/fonts/misc,%{_datadir}/X11/fonts/100dpi,%{_datadir}/X11/fonts/75dpi,%{_prefix}/local/share/fonts,~/.fonts"
-make %{?_smp_mflags}
-make DESTDIR=%{xorg_buildroot} install
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-
-pushd util-macros-*
-echo "Building macros"
-LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared
-make DESTDIR=%{xorg_buildroot} install
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-
-modules="\
- bigreqsproto \
- compositeproto \
- damageproto \
- dri2proto \
- fixesproto \
- fontsproto \
- glproto \
- inputproto \
- kbproto \
- randrproto \
- recordproto \
- renderproto \
- resourceproto \
- scrnsaverproto \
- videoproto \
- xcb-proto \
- xproto \
- xcmiscproto \
- xextproto \
- xf86bigfontproto \
- xf86dgaproto \
- xf86driproto \
- xf86vidmodeproto \
- xineramaproto \
- makedepend \
- xtrans \
- libXau \
- libXdmcp \
- libxcb \
- libX11 \
- libXext \
- libfontenc \
- libICE \
- libSM \
- libXt \
- libXmu \
- libXpm \
- libXaw \
- libXfixes \
- libXcomposite \
- libXrender \
- libXdamage \
- libXcursor \
- libXfont \
- libXft \
- libXi \
- libXinerama \
- libxkbfile \
- libXrandr \
- libXres \
- libXScrnSaver \
- libXtst \
- libXv \
- libXxf86dga \
- libXxf86vm \
- libpciaccess \
- pixman \
- libdrm \
- font-util"
-
-for module in ${modules}; do
- extraoptions=""
- pushd ${module}-*
- echo ======================
- echo configuring ${module}
- echo ======================
-%ifarch i386 i686 x86_64
- if [ "${module}" = "libdrm" ]; then
- autoreconf -fiv
- extraoptions="${extraoptions} --enable-udev --disable-libkms --disable-manpages --disable-intel --disable-radeon --disable-nouveau --disable-vmwgfx"
- fi
-%endif
- if [ "${module}" = "libXdmcp" ]; then
- autoreconf -fiv
- fi
- if [ "${module}" = "libXcursor" ]; then
- autoreconf -fiv
- fi
- if [ "${module}" = "libfontenc" ]; then
- autoconf
- fi
- if [ "${module}" = "libXi" ]; then
- autoreconf -fiv
- fi
- if [ "${module}" = "libXaw" ]; then
- extraoptions="${extraoptions} --disable-xaw8 --disable-xaw6"
- fi
- if [ "${module}" = "libxcb" ]; then
- sed -i 's/pthread-stubs //' configure.ac
- autoreconf -fiv
- fi
- if [ "${module}" = "libX11" ]; then
- autoreconf -fiv
- extraoptions="${extraoptions} --disable-specs"
- fi
- if [ "${module}" = "libSM" ]; then
- extraoptions="${extraoptions} --without-libuuid"
- fi
- if [ "${module}" = "pixman" ]; then
- extraoptions="${extraoptions} --disable-gtk --disable-openmp"
- aclocal -I %{xorg_buildroot}%{_datadir}/aclocal
- autoconf
- autoreconf -fiv
- fi
- if [ "${module}" = "libXfont" ]; then
- extraoptions="${extraoptions} --with-freetype-config=%{xorg_buildroot}%{_bindir}/freetype-config"
- fi
- if [ "${module}" = "libXScrnSaver" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
- elif [ "${module}" = "libxkbfile" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
- elif [ "${module}" = "pixman" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
- elif [ "${module}" = "libXt" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic --with-xfile-search-path="%{_sysconfdir}/X11/%%L/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%l/%%T/\%%N%%C%%S:%{_sysconfdir}/X11/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%L/%%T/%%N%%S:%{_sysconfdir}/X\11/%%l/%%T/%%N%%S:%{_sysconfdir}/X11/%%T/%%N%%S:%{_datadir}/X11/%%L/%%T/%%N%%C%%S:%{_datadir}/X1\1/%%l/%%T/%%N%%C%%S:%{_datadir}/X11/%%T/%%N%%C%%S:%{_datadir}/X11/%%L/%%T/%%N%%S:%{_datadir}/X11/%%\l/%%T/%%N%%S:%{_datadir}/X11/%%T/%%N%%S"
- elif [ "${module}" = "libX11" ]; then
- LDFLAGS="$LDFLAGS -lpthread" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --disable-static --enable-shared --with-pic
- elif [ "${module}" = "libXtst" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
- elif [ "${module}" = "libXpm" ]; then
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
- else
- LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic
- fi
- echo ======================
- echo building ${module}
- echo ======================
- make DESTDIR=%{xorg_buildroot}
- if [ "${module}" = "libX11" ]; then
- make DESTDIR=%{xorg_buildroot} INSTALL="install -p" install
- else
- make DESTDIR=%{xorg_buildroot} install
- fi
- find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
- find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
- find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
- if [ "${module}" = "libxcb" ]; then
- sed 's,@libdir@,%{xorg_buildroot}%{_libdir},;s,@prefix@,%{xorg_buildroot}%{_prefix},;s,@exec_prefix@,%{xorg_buildroot}%{_exec_prefix},' %{SOURCE140} > %{xorg_buildroot}%{_libdir}/pkgconfig/pthread-stubs.pc
- sed -i -e 's/^\(Libs.private:.*\)$/\1 -L${libdir} -lXdmcp -lXau/' %{xorg_buildroot}%{_libdir}/pkgconfig/xcb.pc
- elif [ "${module}" = "libX11" ]; then
- sed -i -e 's/^\(Libs:.*\)$/\1 -ldl/' %{xorg_buildroot}%{_libdir}/pkgconfig/x11.pc
- sed -i -e 's/^\(Libs.private:.*\)$/\1 -L${libdir} -lxcb/' %{xorg_buildroot}%{_libdir}/pkgconfig/x11.pc
- elif [ "${module}" = "libSM" ]; then
- echo 'Libs.private: -L${libdir} -lICE' >> %{xorg_buildroot}%{_libdir}/pkgconfig/sm.pc
- fi
-
- popd
-done
-%else
-pushd xorg
-%endif
-
-%if %{_bootstrap}
-# build mesa
-echo "*** Building Mesa ***"
-pushd Mesa-*
-export PYTHON2=python26
-%ifarch %{ix86}
-sed -i -e 's/-std=c99/-std=gnu99/g' configure.ac
-%endif
-autoreconf -fiv
-%ifarch %{ix86}
-# i do not have words for how much the assembly dispatch code infuriates me
-%define common_flags --disable-selinux --enable-pic --disable-asm
-%else
-%define common_flags --disable-selinux --enable-pic
-%endif
-
-# link libGL statically against any xorg libraries built above
-LDFLAGS="$LDFLAGS -Wl,-Bstatic -lxcb -lXdmcp -lXau -lXext -lXxf86vm -ldrm -Wl,-Bdynamic -lX11 -lpthread -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \
-PKG_CONFIG="pkg-config --static" ./configure %{common_flags} \
- --host=%{_host} \
- --build=%{_build} \
- --prefix=%{_prefix} \
- --libdir=%{_libdir}/tigervnc \
- --disable-osmesa \
- --disable-shared-glapi \
- --disable-egl \
- --disable-gbm \
- --enable-glx \
- --disable-glx-tls \
- --disable-opencl \
- --disable-xvmc \
- --with-dri-driverdir=%{_libdir}/tigervnc/dri \
- --disable-gallium-egl \
- --with-gallium-drivers="" \
- --with-dri-drivers=swrast
-
-make DESTDIR=%{xorg_buildroot}
-make install DESTDIR=%{xorg_buildroot}
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
-popd
-%endif
-
-popd
-
-%if %{_bootstrap}
-echo "*** Building libpng ***"
-pushd libpng-*
-CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
- --host=%{_host} \
- --build=%{_build} \
- --prefix=%{_prefix} \
- --libdir=%{_libdir} \
- --disable-shared \
- --enable-static
-make %{?_smp_mflags}
-make DESTDIR=%{xorg_buildroot} install
-popd
-
-echo "*** Building fltk ***"
-pushd fltk-*
-%endif
-export CMAKE_PREFIX_PATH="%{xorg_buildroot}%{_prefix}:%{_prefix}"
-export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS
-export PKG_CONFIG="pkg-config --static"
-%if %{_bootstrap}
-./configure \
- --host=%{_host} \
- --build=%{_build} \
- --prefix=%{_prefix} \
- --libdir=%{_libdir} \
- --enable-x11 \
- --enable-gl \
- --disable-shared \
- --enable-localjpeg \
- --enable-localzlib \
- --disable-localpng \
- --enable-xinerama \
- --enable-xft \
- --enable-xdbe \
- --enable-xfixes \
- --enable-xcursor \
- --with-x
-make %{?_smp_mflags}
-make DESTDIR=%{xorg_buildroot} install
-popd
-%endif
-
-echo "*** Building VNC ***"
-export CFLAGS="$CFLAGS -fPIC"
-export CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -c //g'`
-%{cmake28} -G"Unix Makefiles" \
- -DFLTK_FLUID_EXECUTABLE=%{xorg_buildroot}%{_bindir}/fluid \
- -DFLTK_LIBRARY_DIR=%{xorg_buildroot}%{_libdir} \
- -DFLTK_INCLUDE_DIR=%{xorg_buildroot}%{_includedir} \
- -DBUILD_STATIC=1 \
- -DCMAKE_BUILD_TYPE=Release \
- -DUSE_INCLUDED_ZLIB=0 \
- -DZLIB_INCLUDE_DIR=%{_includedir} \
- -DZLIB_LIBRARY=%{_libdir}/libz.a \
- -DCMAKE_INSTALL_PREFIX=%{_prefix}
-
-make %{?_smp_mflags}
-
-pushd unix/xserver
-export PIXMANINCDIR=%{xorg_buildroot}%{_includedir}/pixman-1
-sed -i -e 's/^\(\s*WAYLAND_SCANNER_RULES.*\)/dnl\1/' configure.ac
-autoreconf -fiv
-chmod +x ./configure
-# create a relocatable Xvnc so that we can bundle the custom libGL & swrast w/o overwriting existing libs
-GL_LIBS='-Wl,-Bdynamic -lGL' LDFLAGS="$LDFLAGS -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \
-%configure \
- --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_datadir}/man \
- --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} \
- --with-vendor-name="The TigerVNC Project" --with-vendor-name-short="TigerVNC" \
- --with-vendor-web="https://www.tigervnc.org" \
- --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
- --disable-xwin --disable-xephyr --disable-kdrive --disable-wayland \
- --with-pic --enable-static --disable-shared --enable-xinerama \
- --with-default-xkb-rules=base \
- --with-default-font-path="catalogue:%{_sysconfdir}/X11/fontpath.d,%{_datadir}/X11/fonts/misc,%{_datadir}/X11/fonts/OTF,%{_datadir}/X11/fonts/TTF,%{_datadir}/X11/fonts/Type1,%{_datadir}/X11/fonts/100dpi,%{_datadir}/X11/fonts/75dpi,built-ins" \
- --with-serverconfig-path=%{_libdir}/xorg \
- --with-fontrootdir=%{_datadir}/X11/fonts \
- --with-xkb-output=%{_localstatedir}/lib/xkb \
- --enable-install-libxf86config \
- --enable-glx --disable-glx-tls --disable-dri --enable-dri2 --disable-dri3 \
- --disable-present \
- --disable-config-dbus \
- --disable-config-hal \
- --disable-config-udev \
- --without-dtrace \
- --disable-unit-tests \
- --disable-docs \
- --disable-devel-docs \
- --disable-selective-werror \
- --with-sha1=libsha1
-
-make TIGERVNC_SRCDIR=%{tigervnc_src_dir} %{?_smp_mflags}
-popd
-
-# Build icons
-pushd media
-make
-popd
-
-%install
-make install DESTDIR=$RPM_BUILD_ROOT
-
-pushd unix/xserver/hw/vnc
-make install DESTDIR=$RPM_BUILD_ROOT
-popd
-
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri
-install -m644 -p %{xorg_buildroot}%{_libdir}/tigervnc/dri/swrast_dri.so $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri
-for f in `find %{xorg_buildroot}%{_libdir}/tigervnc -name "lib*" -print` ; do
-cp -a $f $RPM_BUILD_ROOT%{_libdir}/tigervnc
-done
-
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
-install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/vncserver
-install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/vncservers
-
-%find_lang %{name} %{name}.lang
-
-%if %{_bootstrap}
-find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{xorg_buildroot}%{_libdir}|libdir=/opt/%{name}/%{scl_name}%{_libdir}|" {} \;
-find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{xorg_buildroot}%{_prefix}|prefix=/opt/%{name}/%{scl_name}%{_prefix}|" {} \;
-%endif
-
-# remove unwanted files
-rm -rf $RPM_BUILD_ROOT%{_libdir}/tigervnc/pkgconfig
-rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig
-rm -rf $RPM_BUILD_ROOT%{_libdir}/xorg
-rm -rf $RPM_BUILD_ROOT%{_includedir}
-rm -f $RPM_BUILD_ROOT%{_libdir}/tigervnc/*.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri/*.la
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%post
-touch -c %{_datadir}/icons/hicolor
-if [ -x %{_bindir}/gtk-update-icon-cache ]; then
- %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || :
-fi
-
-%postun
-touch -c %{_datadir}/icons/hicolor
-if [ -x %{_bindir}/gtk-update-icon-cache ]; then
- %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || :
-fi
-
-%post server
-/sbin/chkconfig --add vncserver
-
-%preun server
-if [ $1 -eq 0 ]; then
- /sbin/service vncserver stop &>/dev/null || :
- /sbin/chkconfig --del vncserver
-fi
-
-%postun server
-/sbin/service vncserver condrestart &>/dev/null || :
-
-%files -f %{name}.lang
-%defattr(-,root,root,-)
-%doc README.rst
-%{_bindir}/vncviewer
-%{_datadir}/applications/*
-%{_mandir}/man1/vncviewer.1*
-
-%files server
-%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/sysconfig/vncservers
-%config(noreplace) %{_sysconfdir}/init.d/vncserver
-%{_bindir}/x0vncserver
-%{_bindir}/vncserver
-%{_mandir}/man1/vncserver.1*
-%{_mandir}/man1/x0vncserver.1*
-
-%files server-minimal
-%defattr(-,root,root,-)
-%{_bindir}/vncconfig
-%{_bindir}/vncpasswd
-%{_bindir}/Xvnc
-%{_mandir}/man1/Xvnc.1*
-%{_mandir}/man1/vncpasswd.1*
-%{_mandir}/man1/vncconfig.1*
-%{_libdir}/*
-
-%files license
-%defattr(-,root,root,-)
-%doc LICENCE.TXT
-
-%files icons
-%defattr(-,root,root,-)
-%{_datadir}/icons/hicolor/*/apps/*
-
-%if %{_bootstrap}
-%files static-devel
-%defattr(-,root,root,-)
-/opt/%{name}/%{scl_name}%{_sysconfdir}/*
-/opt/%{name}/%{scl_name}%{_bindir}/*
-/opt/%{name}/%{scl_name}%{_datadir}/*
-/opt/%{name}/%{scl_name}%{_includedir}/*
-/opt/%{name}/%{scl_name}%{_libdir}/*
-%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
-/opt/%{name}/%{scl_name}%{_prefix}/lib/python2.6/*
-%endif
-%endif
-
-%changelog
-* Fri Dec 11 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-3
-- Configure with --host and --build to avoid build host-specific compiler opts
-
-* Fri Nov 27 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-2
-- Split static pre-reqs into separate package
-
-* Thu Nov 26 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-1
-- Version bump for 1.6 release
-- Update libjpeg-turbo, gnutls, libtasn1, libpng to latest upstream versions.
-
-* Sun Sep 12 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.5.80-8
-- Build Xvnc with link path relative to $ORIGIN and apply dridir patch
- to make it portable.
-
-* Sun Aug 09 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.5.80-7
-- Patch Xorg sources with latest relevant CVE patches.
-- Update libjpeg-turbo, gnutls, libtasn1 to latest upstream versions.
-
-* Sat Mar 14 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-6
-- Build static libraries to meet new minimum requirements
-
-* Sat Mar 07 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-5
-- Don't disable xinerama extension
-
-* Thu Feb 19 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-4
-- Bumped fltk to 1.3.3, no longer requires patching
-
-* Mon Jan 19 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.0-3
-- Added default font paths to Xvnc and fontconfig
-- Added vendor strings to Xvnc
-- Specified xfile-search-path when configuring libXt the same way el6 does
-
-* Wed Dec 24 2014 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-1.20141119git59c5a55c
-- Rebuilt against Xorg 7.7 with CVE-2104-12-09 patches from debian.
-- Bumped versions of Mesa, Freetype, fontconfig, etc.
-- Link against our own version of libGL to improve portability.
-- Added static libsha1 to avoid linking against libssl.so.
-
-* Wed Nov 19 2014 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.80-18.20141119git59c5a55c
-- Removed server module sub-package
-
-* Thu Nov 28 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.80-17.20131128svn5139
-- Bumped version to 1.3.80
-- Cleaned up linter warnings
-
-* Thu Jul 05 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.0
-- Upstream 1.3.0 release
-- Conditional-ized %snap for release
-
-* Fri Jun 14 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.90-14.20130531svn5120
-- Update libjpeg-turbo to 1.3.0
-
-* Fri May 24 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.90-14.20130524svn5114
-- Improve spec file portability
-
-* Fri May 17 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.90-13.20130425svn5087
-- Improve portability with more static linking
-
-* Thu Apr 04 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.80-12.20130330svn5066
-- Added conditional -march arg to libdrm-intel to allow building on i386
-- Fixed version to reflect upstream pre-release versioning
-
-* Sat Mar 30 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-11.20130330svn5066
-- Updated to TigerVNC svn 5066
-- Updated fltk to 1.3.2 and updated fltk patches per BUILDING.txt
-- Fixed vncserver init script & config file which had been overwritten by
- systemd versions.
-
-* Wed Nov 28 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-7.20120915svn4999
-- Changed BuildRequires to cmake28
-- Set PIXMANINCDIR when building Xvnc
-
-* Tue Sep 18 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-6.20120915svn4999
-- Applied icon support patch
-
-* Sat Sep 15 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-5.20120915svn4999
-- Update to TigerVNC svn r4999 snapshot
-- Build a static libjpeg-turbo to remove the external dependency
-- Applied Cendio's Fltk patches, except for the icon patch which I cannot get to build
- without creating undefined reference errors during linking
-
-* Thu Jul 19 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-4.20120719svn4941
-- Update to TigerVNC svn r4941 snapshot
-- Removed border-hook.patch since it's been committed
-
-* Wed Jul 18 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-3.20120715svn4937
-- Update to TigerVNC svn r4937 snapshot
-- Applied border-hook.patch from devel list to fix bug #3415308
-- Use build order recommended by cgit.freedesktop.org/xorg/util/modular/tree/build.sh
-- Removed tigervnc11-rh692048.patch as it seems to break support for VeNCrypt
-
-* Sun Jul 15 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-1.20120715svn4935
-- Adapted spec file for building static linked binary on RHEL5 from F16
- spec file and DRC's build-xorg script included in src tarball.
-- Update to TigerVNC svn r4935 snapshot
-- Need to use inkscape on RHEL5 because convert is broken
-
-* Tue Nov 22 2011 Adam Tkac <atkac redhat com> - 1.1.0-3
-- don't build X.Org devel docs (#755782)
-- applet: BR generic java-devel instead of java-gcj-devel (#755783)
-- use runuser to start Xvnc in systemd service file (#754259)
-- don't attepmt to restart Xvnc session during update/erase (#753216)
-
-* Fri Nov 11 2011 Adam Tkac <atkac redhat com> - 1.1.0-2
-- libvnc.so: don't use unexported GetMaster function (#744881)
-- remove nasm buildreq
-
-* Mon Sep 12 2011 Adam Tkac <atkac redhat com> - 1.1.0-1
-- update to 1.1.0
-- update the xorg11 patch
-- patches merged
- - tigervnc11-glx.patch
- - tigervnc11-CVE-2011-1775.patch
- - 0001-Use-memmove-instead-of-memcpy-in-fbblt.c-when-memory.patch
-
-* Thu Jul 28 2011 Adam Tkac <atkac redhat com> - 1.0.90-6
-- add systemd service file and remove legacy SysV initscript (#717227)
-
-* Tue May 12 2011 Adam Tkac <atkac redhat com> - 1.0.90-5
-- make Xvnc buildable against X.Org 1.11
-
-* Tue May 10 2011 Adam Tkac <atkac redhat com> - 1.0.90-4
-- viewer can send password without proper validation of X.509 certs
- (CVE-2011-1775)
-
-* Wed Apr 13 2011 Adam Tkac <atkac redhat com> - 1.0.90-3
-- fix wrong usage of memcpy which caused screen artifacts (#652590)
-- don't point to inaccessible link in sysconfig/vncservers (#644975)
-
-* Fri Apr 08 2011 Adam Tkac <atkac redhat com> - 1.0.90-2
-- improve compatibility with vinagre client (#692048)
-
-* Tue Mar 22 2011 Adam Tkac <atkac redhat com> - 1.0.90-1
-- update to 1.0.90
-
-* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.90-0.32.20110117svn4237
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
-
-* Mon Jan 17 2011 Adam Tkac <atkac redhat com> 1.0.90-0.31.20110117svn4237
-- fix libvnc.so module loading
-
-* Mon Jan 17 2011 Adam Tkac <atkac redhat com> 1.0.90-0.30.20110117svn4237
-- update to r4237
-- patches merged
- - tigervnc11-optionsdialog.patch
- - tigervnc11-rh607866.patch
-
-* Fri Jan 14 2011 Adam Tkac <atkac redhat com> 1.0.90-0.29.20101208svn4225
-- improve patch for keyboard issues
-
-* Fri Jan 14 2011 Adam Tkac <atkac redhat com> 1.0.90-0.28.20101208svn4225
-- attempt to fix various keyboard-related issues (key repeating etc)
-
-* Fri Jan 07 2011 Adam Tkac <atkac redhat com> 1.0.90-0.27.20101208svn4225
-- render "Ok" and "Cancel" buttons in the options dialog correctly
-
-* Wed Dec 15 2010 Jan Görig <jgorig redhat com> 1.0.90-0.26.20101208svn4225
-- added vncserver lock file (#662784)
-
-* Fri Dec 10 2010 Adam Tkac <atkac redhat com> 1.0.90-0.25.20101208svn4225
-- update to r4225
-- patches merged
- - tigervnc11-rh611677.patch
- - tigervnc11-rh633931.patch
- - tigervnc11-xorg1.10.patch
-- enable VeNCrypt and PAM support
-
-* Mon Dec 06 2010 Adam Tkac <atkac redhat com> 1.0.90-0.24.20100813svn4123
-- rebuild against xserver 1.10.X
-- 0001-Return-Success-from-generate_modkeymap-when-max_keys.patch merged
-
-* Wed Sep 29 2010 jkeating - 1.0.90-0.23.20100813svn4123
-- Rebuilt for gcc bug 634757
-
-* Tue Sep 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.22.20100420svn4030
-- drop xorg-x11-fonts-misc dependency (#636170)
-
-* Tue Sep 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.21.20100420svn4030
-- improve patch for #633645 (fix tcsh incompatibilities)
-
-* Thu Sep 16 2010 Adam Tkac <atkac redhat com> 1.0.90-0.20.20100813svn4123
-- press fake modifiers correctly (#633931)
-- supress unneeded debug information emitted from initscript (#633645)
-
-* Wed Aug 25 2010 Adam Tkac <atkac redhat com> 1.0.90-0.19.20100813svn4123
-- separate Xvnc, vncpasswd and vncconfig to -server-minimal subpkg (#626946)
-- move license to separate subpkg and Requires it from main subpkgs
-- Xvnc: handle situations when no modifiers exist well (#611677)
-
-* Fri Aug 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.18.20100813svn4123
-- update to r4123 (#617973)
-- add perl requires to -server subpkg (#619791)
-
-* Thu Jul 22 2010 Adam Tkac <atkac redhat com> 1.0.90-0.17.20100721svn4113
-- update to r4113
-- patches merged
- - tigervnc11-rh586406.patch
- - tigervnc11-libvnc.patch
- - tigervnc11-rh597172.patch
- - tigervnc11-rh600070.patch
- - tigervnc11-options.patch
-- don't own %%{_datadir}/icons directory (#614301)
-- minor improvements in the .desktop file (#616340)
-- bundled libjpeg configure requires nasm; is executed even if system-wide
- libjpeg is used
-
-* Fri Jul 02 2010 Adam Tkac <atkac redhat com> 1.0.90-0.16.20100420svn4030
-- build against system-wide libjpeg-turbo (#494458)
-- build no longer requires nasm
-
-* Mon Jun 28 2010 Adam Tkac <atkac redhat com> 1.0.90-0.15.20100420svn4030
-- vncserver: accept <+optname> option when specified as the first one
-
-* Thu Jun 24 2010 Adam Tkac <atkac redhat com> 1.0.90-0.14.20100420svn4030
-- fix memory leak in Xvnc input code (#597172)
-- don't crash when receive negative encoding (#600070)
-- explicitly disable udev configuration support
-- add gettext-autopoint to BR
-
-* Mon Jun 14 2010 Adam Tkac <atkac redhat com> 1.0.90-0.13.20100420svn4030
-- update URL about SSH tunneling in the sysconfig file (#601996)
-
-* Fri Jun 11 2010 Adam Tkac <atkac redhat com> 1.0.90-0.12.20100420svn4030
-- use newer gettext
-- autopoint now uses git instead of cvs, adjust BuildRequires appropriately
-
-* Thu May 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.11.20100420svn4030
-- link libvnc.so "now" to catch "undefined symbol" errors during Xorg startup
-- use always XkbConvertCase instead of XConvertCase (#580159, #586406)
-- don't link libvnc.so against libXi.la, libdix.la and libxkb.la; use symbols
- from Xorg instead
-
-* Thu May 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.10.20100420svn4030
-- update to r4030 snapshot
-- patches merged to upstream
- - tigervnc11-rh522369.patch
- - tigervnc11-rh551262.patch
- - tigervnc11-r4002.patch
- - tigervnc11-r4014.patch
-
-* Thu Apr 08 2010 Adam Tkac <atkac redhat com> 1.0.90-0.9.20100219svn3993
-- add server-applet subpackage which contains Java vncviewer applet
-- fix Java applet; it didn't work when run from web browser
-- add xorg-x11-xkb-utils to server Requires
-
-* Fri Mar 12 2010 Adam Tkac <atkac redhat com> 1.0.90-0.8.20100219svn3993
-- add French translation to vncviewer.desktop (thanks to Alain Portal)
-
-* Thu Mar 04 2010 Adam Tkac <atkac redhat com> 1.0.90-0.7.20100219svn3993
-- don't crash during pixel format change (#522369, #551262)
-
-* Mon Mar 01 2010 Adam Tkac <atkac redhat com> 1.0.90-0.6.20100219svn3993
-- add mesa-dri-drivers and xkeyboard-config to -server Requires
-- update to r3993 1.0.90 snapshot
- - tigervnc11-noexecstack.patch merged
- - tigervnc11-xorg18.patch merged
- - xserver18.patch is no longer needed
-
-* Wed Jan 27 2010 Jan Gorig <jgorig redhat com> 1.0.90-0.5.20091221svn3929
-- initscript LSB compliance fixes (#523974)
-
-* Fri Jan 22 2010 Adam Tkac <atkac redhat com> 1.0.90-0.4.20091221svn3929
-- mark stack as non-executable in jpeg ASM code
-- add xorg-x11-xauth to Requires
-- add support for X.Org 1.8
-- drop shave sources, they are no longer needed
-
-* Thu Jan 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.3.20091221svn3929
-- drop tigervnc-xorg25909.patch, it has been merged to X.Org upstream
-
-* Thu Jan 07 2010 Adam Tkac <atkac redhat com> 1.0.90-0.2.20091221svn3929
-- add patch for upstream X.Org issue #25909
-- add libXdmcp-devel to build requires to build Xvnc with XDMCP support (#552322)
-
-* Mon Dec 21 2009 Adam Tkac <atkac redhat com> 1.0.90-0.1.20091221svn3929
-- update to 1.0.90 snapshot
-- patches merged
- - tigervnc10-compat.patch
- - tigervnc10-rh510185.patch
- - tigervnc10-rh524340.patch
- - tigervnc10-rh516274.patch
-
-* Mon Oct 26 2009 Adam Tkac <atkac redhat com> 1.0.0-3
-- create Xvnc keyboard mapping before first keypress (#516274)
-
-* Thu Oct 08 2009 Adam Tkac <atkac redhat com> 1.0.0-2
-- update underlying X source to 1.6.4-0.3.fc11
-- remove bogus '-nohttpd' parameter from /etc/sysconfig/vncservers (#525629)
-- initscript LSB compliance fixes (#523974)
-- improve -LowColorSwitch documentation and handling (#510185)
-- honor dotWhenNoCursor option (and it's changes) every time (#524340)
-
-* Fri Aug 28 2009 Adam Tkac <atkac redhat com> 1.0.0-1
-- update to 1.0.0
-- tigervnc10-rh495457.patch merged to upstream
-
-* Mon Aug 24 2009 Karsten Hopp <karsten@redhat.com> 0.0.91-0.17
-- fix ifnarch s390x for server-module
-
-* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.0.91-0.16
-- rebuilt with new openssl
-
-* Tue Aug 04 2009 Adam Tkac <atkac redhat com> 0.0.91-0.15
-- make Xvnc compilable
-
-* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.91-0.14.1
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
-
-* Mon Jul 13 2009 Adam Tkac <atkac redhat com> 0.0.91-0.13.1
-- don't write warning when initscript is called with condrestart param (#508367)
-
-* Tue Jun 23 2009 Adam Tkac <atkac redhat com> 0.0.91-0.13
-- temporary use F11 Xserver base to make Xvnc compilable
-- BuildRequires: libXi-devel
-- don't ship tigervnc-server-module on s390/s390x
-
-* Mon Jun 22 2009 Adam Tkac <atkac redhat com> 0.0.91-0.12
-- fix local rendering of cursor (#495457)
-
-* Thu Jun 18 2009 Adam Tkac <atkac redhat com> 0.0.91-0.11
-- update to 0.0.91 (1.0.0 RC1)
-- patches merged
- - tigervnc10-rh499401.patch
- - tigervnc10-rh497592.patch
- - tigervnc10-rh501832.patch
-- after discusion in upstream drop tigervnc-bounds.patch
-- configure flags cleanup
-
-* Thu May 21 2009 Adam Tkac <atkac redhat com> 0.0.90-0.10
-- rebuild against 1.6.1.901 X server (#497835)
-- disable i18n, vncviewer is not UTF-8 compatible (#501832)
-
-* Mon May 18 2009 Adam Tkac <atkac redhat com> 0.0.90-0.9
-- fix vncpasswd crash on long passwords (#499401)
-- start session dbus daemon correctly (#497592)
-
-* Mon May 11 2009 Adam Tkac <atkac redhat com> 0.0.90-0.8.1
-- remove merged tigervnc-manminor.patch
-
-* Tue May 05 2009 Adam Tkac <atkac redhat com> 0.0.90-0.8
-- update to 0.0.90
-
-* Thu Apr 30 2009 Adam Tkac <atkac redhat com> 0.0.90-0.7.20090427svn3789
-- server package now requires xorg-x11-fonts-misc (#498184)
-
-* Mon Apr 27 2009 Adam Tkac <atkac redhat com> 0.0.90-0.6.20090427svn3789
-- update to r3789
- - tigervnc-rh494801.patch merged
-- tigervnc-newfbsize.patch is no longer needed
-- fix problems when vncviewer and Xvnc run on different endianess (#496653)
-- UltraVNC and TightVNC clients work fine again (#496786)
-
-* Wed Apr 08 2009 Adam Tkac <atkac redhat com> 0.0.90-0.5.20090403svn3751
-- workaround broken fontpath handling in vncserver script (#494801)
-
-* Fri Apr 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.4.20090403svn3751
-- update to r3751
-- patches merged
- - tigervnc-xclients.patch
- - tigervnc-clipboard.patch
- - tigervnc-rh212985.patch
-- basic RandR support in Xvnc (resize of the desktop)
-- use built-in libjpeg (SSE2/MMX accelerated encoding on x86 platform)
-- use Tight encoding by default
-- use TigerVNC icons
-
-* Tue Mar 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.3.20090303svn3631
-- update to r3631
-
-* Tue Mar 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.2.20090302svn3621
-- package review related fixes
-
-* Mon Mar 02 2009 Adam Tkac <atkac redhat com> 0.0.90-0.1.20090302svn3621
-- initial package, r3621