[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libxtst: Changes to 'debian-unstable'



 COPYING          |   50 +++++++++++++++++++++++++++++++
 ChangeLog        |   86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 autogen.sh       |    4 +-
 configure.ac     |    9 ++++-
 debian/changelog |   15 ++++++++-
 debian/compat    |    2 -
 debian/control   |   10 +++---
 debian/rules     |   15 +++------
 src/Makefile.am  |    6 ++-
 src/XRecord.c    |   55 ++++++++++++++++++++++++-----------
 xtst.pc.in       |    2 -
 11 files changed, 213 insertions(+), 41 deletions(-)

New commits:
commit 4498d3c857c6b14b2038c593e56f20cb91d80ac3
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Aug 12 20:33:06 2013 +0200

    Upload to unstable

diff --git a/debian/changelog b/debian/changelog
index cc5bf55..0dda428 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libxtst (2:1.2.2-1) UNRELEASED; urgency=low
+libxtst (2:1.2.2-1) unstable; urgency=low
 
   * New upstream release.
   * debian/copyright: add copyright notices and licenses from the manpages and
@@ -8,7 +8,7 @@ libxtst (2:1.2.2-1) UNRELEASED; urgency=low
   * Disable silent build rules.
   * Use dh_prep instead of dh_clean -k.
 
- -- Julien Cristau <jcristau@debian.org>  Mon, 12 Aug 2013 20:18:22 +0200
+ -- Julien Cristau <jcristau@debian.org>  Mon, 12 Aug 2013 20:33:03 +0200
 
 libxtst (2:1.2.1-1+deb7u1) wheezy-security; urgency=high
 

commit b3b78ef721e53b8e7ce582c35205d450706b682a
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Aug 12 20:33:00 2013 +0200

    Use dh_prep instead of dh_clean -k.

diff --git a/debian/changelog b/debian/changelog
index 4910ad4..cc5bf55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ libxtst (2:1.2.2-1) UNRELEASED; urgency=low
   * Bump debhelper compat level to 7.
   * Use dpkg-buildflags.
   * Disable silent build rules.
+  * Use dh_prep instead of dh_clean -k.
 
  -- Julien Cristau <jcristau@debian.org>  Mon, 12 Aug 2013 20:18:22 +0200
 
diff --git a/debian/rules b/debian/rules
index cd14f28..141505a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -64,7 +64,7 @@ clean: xsfclean
 install: build-stamp
 	dh_testdir
 	dh_testroot
-	dh_clean -k
+	dh_prep
 	dh_installdirs
 
 	cd build && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install

commit 679296072809d8f0b8ae739631be2094db948930
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Aug 12 20:23:07 2013 +0200

    Disable silent build rules.

diff --git a/debian/changelog b/debian/changelog
index 8a8b9ac..4910ad4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ libxtst (2:1.2.2-1) UNRELEASED; urgency=low
     specs.  Thanks, Ansgar!
   * Bump debhelper compat level to 7.
   * Use dpkg-buildflags.
+  * Disable silent build rules.
 
  -- Julien Cristau <jcristau@debian.org>  Mon, 12 Aug 2013 20:18:22 +0200
 
diff --git a/debian/rules b/debian/rules
index 11e9876..cd14f28 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,6 +42,7 @@ build-stamp: $(STAMP_DIR)/patch
 	             --infodir=\$${prefix}/share/info $(confflags) \
 	             --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
 	             --docdir=\$${prefix}/share/doc/libxtst-dev \
+		     --disable-silent-rules \
 		     $(docflags) \
 		     $(shell DEB_CFLAGS_MAINT_APPEND=-Wall dpkg-buildflags --export=configure)
 	cd build && $(MAKE)

commit fcd236320388f8d2b52d374e518763de1b3283e8
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Aug 12 20:22:34 2013 +0200

    Use dpkg-buildflags.

diff --git a/debian/changelog b/debian/changelog
index fb76a43..8a8b9ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ libxtst (2:1.2.2-1) UNRELEASED; urgency=low
   * debian/copyright: add copyright notices and licenses from the manpages and
     specs.  Thanks, Ansgar!
   * Bump debhelper compat level to 7.
+  * Use dpkg-buildflags.
 
  -- Julien Cristau <jcristau@debian.org>  Mon, 12 Aug 2013 20:18:22 +0200
 
diff --git a/debian/control b/debian/control
index c4aaab0..cf773ba 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
 Uploaders: Cyril Brulebois <kibi@debian.org>
 Build-Depends:
- dpkg-dev (>= 1.16),
+ dpkg-dev (>= 1.16.1),
  debhelper (>= 7),
  libx11-dev (>= 2:0.99.3),
  libxext-dev (>= 2:1.0.99.4),
diff --git a/debian/rules b/debian/rules
index 1145fad..11e9876 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,12 +12,6 @@ PACKAGE = libxtst6
 
 include debian/xsfbs/xsfbs.mk
 
-CFLAGS = -Wall -g
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 	MAKEFLAGS += -j$(NUMJOBS)
@@ -49,7 +43,7 @@ build-stamp: $(STAMP_DIR)/patch
 	             --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
 	             --docdir=\$${prefix}/share/doc/libxtst-dev \
 		     $(docflags) \
-	             CFLAGS="$(CFLAGS)" 
+		     $(shell DEB_CFLAGS_MAINT_APPEND=-Wall dpkg-buildflags --export=configure)
 	cd build && $(MAKE)
 	>$@
 

commit ccb0d036c5b6ba0642b31729aeae1d0dee3fbb0d
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Aug 12 20:21:14 2013 +0200

    Cosmetic d/control fixup

diff --git a/debian/control b/debian/control
index 7289a36..c4aaab0 100644
--- a/debian/control
+++ b/debian/control
@@ -19,9 +19,9 @@ Build-Depends:
  xutils-dev (>= 1:7.6+2),
  quilt,
 # specs:
-  xmlto (>= 0.0.22),
-  xorg-sgml-doctools (>= 1:1.8),
-  w3m,
+ xmlto (>= 0.0.22),
+ xorg-sgml-doctools (>= 1:1.8),
+ w3m,
 Standards-Version: 3.8.3
 Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libxtst
 Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/libxtst.git

commit 0249cca0167b1e3f078ed64e303503fa4bbc3fd6
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Aug 12 20:21:07 2013 +0200

    Bump debhelper compat level to 7.

diff --git a/debian/changelog b/debian/changelog
index 5d3c61a..fb76a43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ libxtst (2:1.2.2-1) UNRELEASED; urgency=low
   * New upstream release.
   * debian/copyright: add copyright notices and licenses from the manpages and
     specs.  Thanks, Ansgar!
+  * Bump debhelper compat level to 7.
 
  -- Julien Cristau <jcristau@debian.org>  Mon, 12 Aug 2013 20:18:22 +0200
 
diff --git a/debian/compat b/debian/compat
index 7ed6ff8..7f8f011 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+7
diff --git a/debian/control b/debian/control
index ce621e8..7289a36 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
 Uploaders: Cyril Brulebois <kibi@debian.org>
 Build-Depends:
  dpkg-dev (>= 1.16),
- debhelper (>= 5.0.0),
+ debhelper (>= 7),
  libx11-dev (>= 2:0.99.3),
  libxext-dev (>= 2:1.0.99.4),
  libxi-dev,
diff --git a/debian/rules b/debian/rules
index a1bdb0b..1145fad 100755
--- a/debian/rules
+++ b/debian/rules
@@ -79,8 +79,8 @@ binary-arch: build-arch install
 	dh_testdir
 	dh_testroot
 	dh_installdocs -s
-	dh_install -s --sourcedir=debian/tmp --fail-missing -XlibXtst.la
-	dh_installchangelogs -s ChangeLog
+	dh_install -s --fail-missing -XlibXtst.la
+	dh_installchangelogs -s
 	dh_installman -s
 	dh_link -s
 	dh_strip -p$(PACKAGE) --dbg-package=$(PACKAGE)-dbg

commit 573361429ca351d2e464bb88e7db669e19607d0c
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Aug 12 20:19:13 2013 +0200

    Bump changelogs

diff --git a/ChangeLog b/ChangeLog
index 4677bec..c0e3b3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,89 @@
+commit cdc04f06325e55916e0c95b61db626d22b76e2ff
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu May 30 19:09:42 2013 -0700
+
+    libXtst 1.2.2
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit e7e04b7be3f018ad636aba3a36bfc1cd80b9906d
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sat Apr 13 11:27:26 2013 -0700
+
+    integer overflow in XRecordGetContext() [CVE-2013-2063]
+    
+    The nclients and nranges members of the reply are both CARD32 and need
+    to be bounds checked before multiplying by the size of the structs to
+    avoid integer overflow leading to underallocation and writing data from
+    the network past the end of the allocated buffer.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 46ed6283034b5b7d14584009453f5d974cfacf1e
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sat Apr 13 11:05:27 2013 -0700
+
+    Use _XEatDataWords to eat data in error cases
+    
+    Avoids having to do calculcations based on response contents
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 2aafac9474a0a0a0c39797862f823255918cf368
+Author: Colin Walters <walters@verbum.org>
+Date:   Wed Jan 4 17:37:06 2012 -0500
+
+    autogen.sh: Implement GNOME Build API
+    
+    http://people.gnome.org/~walters/docs/build-api.txt
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 34cfa2d2b76640f672170dfbd8b5dd4a06d95b4d
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Jan 15 14:28:48 2013 -0500
+
+    configure: Remove AM_MAINTAINER_MODE
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 6394218aae6599b28ced3d30074e154ba4218d07
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Mon Apr 23 22:02:20 2012 -0700
+
+    Add xextproto & xi to Requires.private
+    
+    Only headers are needed, not libraries to link with.   Required for
+    includes of xtestconst.h (xextproto) and XInput.h (xi) in XTest.h
+    public header.
+    
+    Fixes https://bugs.freedesktop.org/attachment.cgi?id=59835
+    (originally reported as https://bugzilla.novell.com/show_bug.cgi?id=748808 )
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 023d494822fea9c3840e75964451fd9d5213ae06
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Mon Apr 23 22:01:16 2012 -0700
+
+    Move -I flags from AM_CFLAGS to AM_CPPFLAGS
+    
+    Ensures local copy of headers takes precedence over any -I flags the
+    builder may have passed in CPPFLAGS.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 30506c32f69ea476f3b068ec3bf9b1c2a24991b8
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Tue Apr 24 21:04:06 2012 +0200
+
+    COPYING: add copyright notices and licenses from the manpages and specs
+    
+    Reported-by: Ansgar Burchardt
+    Signed-off-by: Julien Cristau <jcristau@debian.org>
+
 commit eb177d24ffb459af6205d2658c3a158449660caf
 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
 Date:   Wed Mar 7 21:11:34 2012 -0800
diff --git a/debian/changelog b/debian/changelog
index fdcba94..5d3c61a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,10 @@
-libxtst (2:1.2.1-2) UNRELEASED; urgency=low
+libxtst (2:1.2.2-1) UNRELEASED; urgency=low
 
+  * New upstream release.
   * debian/copyright: add copyright notices and licenses from the manpages and
     specs.  Thanks, Ansgar!
 
- -- Julien Cristau <jcristau@debian.org>  Tue, 24 Apr 2012 21:08:19 +0200
+ -- Julien Cristau <jcristau@debian.org>  Mon, 12 Aug 2013 20:18:22 +0200
 
 libxtst (2:1.2.1-1+deb7u1) wheezy-security; urgency=high
 

commit cdc04f06325e55916e0c95b61db626d22b76e2ff
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu May 30 19:09:42 2013 -0700

    libXtst 1.2.2
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/configure.ac b/configure.ac
index d83d4d8..c169598 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libXtst], [1.2.1],
+AC_INIT([libXtst], [1.2.2],
 	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXtst])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])

commit 288326f60ffb199b80ce04bcbd660d29ecd59e64
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue May 14 20:13:08 2013 +0200

    Upload to wheezy-security

diff --git a/debian/changelog b/debian/changelog
index cc85c41..5d3709e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libxtst (2:1.2.1-1+deb7u1) wheezy-security; urgency=high
+
+  * integer overflow in XRecordGetContext() [CVE-2013-2063]
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 14 May 2013 20:12:48 +0200
+
 libxtst (2:1.2.1-1) unstable; urgency=low
 
   * New upstream release.

commit b10c9b6464f946e25903b4b685de67ad4f1e7ede
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Apr 13 11:27:26 2013 -0700

    integer overflow in XRecordGetContext() [CVE-2013-2063]
    
    The nclients and nranges members of the reply are both CARD32 and need
    to be bounds checked before multiplying by the size of the structs to
    avoid integer overflow leading to underallocation and writing data from
    the network past the end of the allocated buffer.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Julien Cristau <jcristau@debian.org>

diff --git a/src/XRecord.c b/src/XRecord.c
index ba628b6..5bbd5ac 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -420,11 +420,9 @@ XRecordGetContext(Display *dpy, XRecordContext context,
     XExtDisplayInfo 	*info = find_display (dpy);
     register 		xRecordGetContextReq   	*req;
     xRecordGetContextReply 	rep;
-    int			count, i, rn;
+    unsigned int	count, i, rn;
     xRecordRange   	xrange;
-    XRecordRange	*ranges = NULL;
     xRecordClientInfo   xclient_inf;
-    XRecordClientInfo	**client_inf, *client_inf_str = NULL;
     XRecordState	*ret;
 
     XRecordCheckExtension (dpy, info, 0);
@@ -454,13 +452,18 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 
     if (count)
     {
-     	client_inf = (XRecordClientInfo **) Xcalloc(count, sizeof(XRecordClientInfo*));
-	ret->client_info = client_inf;
-	if (client_inf != NULL) {
-	    client_inf_str = (XRecordClientInfo *) Xmalloc(count*sizeof(XRecordClientInfo));
+	XRecordClientInfo	**client_inf = NULL;
+	XRecordClientInfo	*client_inf_str = NULL;
+
+	if (count < (INT_MAX / sizeof(XRecordClientInfo))) {
+	    client_inf = Xcalloc(count, sizeof(XRecordClientInfo *));
+	    if (client_inf != NULL)
+		client_inf_str = Xmalloc(count * sizeof(XRecordClientInfo));
 	}
+	ret->client_info = client_inf;
         if (!client_inf || !client_inf_str)
         {
+	   free(client_inf);
 	   _XEatDataWords (dpy, rep.length);
 	   UnlockDisplay(dpy);
 	   XRecordFreeState(ret);
@@ -476,11 +479,18 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 
 	    if (xclient_inf.nRanges)
 	    {
-		client_inf_str[i].ranges = (XRecordRange**) Xcalloc(xclient_inf.nRanges, sizeof(XRecordRange*));
-		if (client_inf_str[i].ranges != NULL) {
-		    ranges = (XRecordRange*)
-			Xmalloc(xclient_inf.nRanges * sizeof(XRecordRange));
+		XRecordRange	*ranges = NULL;
+
+		if (xclient_inf.nRanges < (INT_MAX / sizeof(XRecordRange))) {
+		    client_inf_str[i].ranges =
+			Xcalloc(xclient_inf.nRanges, sizeof(XRecordRange *));
+		    if (client_inf_str[i].ranges != NULL)
+			ranges =
+			    Xmalloc(xclient_inf.nRanges * sizeof(XRecordRange));
 		}
+		else
+		    client_inf_str[i].ranges = NULL;
+
 		if (!client_inf_str[i].ranges || !ranges) {
 		    /* XXX eat data */
 		    UnlockDisplay(dpy);

commit a99dc41bfcd46ff404d654616b4e3e97ac1d71a4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Apr 13 11:05:27 2013 -0700

    Use _XEatDataWords to eat data in error cases
    
    Avoids having to do calculcations based on response contents
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Julien Cristau <jcristau@debian.org>

diff --git a/configure.ac b/configure.ac
index 1f2927f..5796d1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,12 @@ XORG_CHECK_SGML_DOCTOOLS(1.8)
 # Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(XTST, x11 [xext >= 1.0.99.4] xi [recordproto >= 1.13.99.1] [xextproto >= 7.0.99.3] inputproto)
 
+# Check for _XEatDataWords function that may be patched into older Xlib release
+SAVE_LIBS="$LIBS"
+LIBS="$XTST_LIBS"
+AC_CHECK_FUNCS([_XEatDataWords])
+LIBS="$SAVE_LIBS"
+
 # Determine if the source for man pages is available
 # It may already be present (tarball) or can be generated using xmlto
 AM_CONDITIONAL([INSTALL_MANPAGES],
diff --git a/src/XRecord.c b/src/XRecord.c
index b65451c..ba628b6 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -49,6 +49,9 @@ from The Open Group.
  * By Stephen Gildea, X Consortium, and Martha Zimet, NCD.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <stdio.h>
 #include <assert.h>
 #include <X11/Xlibint.h>
@@ -56,6 +59,18 @@ from The Open Group.
 #include <X11/extensions/extutil.h>
 #include <X11/extensions/recordproto.h>
 #include <X11/extensions/record.h>
+#include <limits.h>
+
+#ifndef HAVE__XEATDATAWORDS
+static inline void _XEatDataWords(Display *dpy, unsigned long n)
+{
+# ifndef LONG64
+    if (n >= (ULONG_MAX >> 2))
+        _XIOError(dpy);
+# endif
+    _XEatData (dpy, n << 2);
+}
+#endif
 
 static XExtensionInfo _xrecord_info_data;
 static XExtensionInfo *xrecord_info = &_xrecord_info_data;
@@ -427,7 +442,7 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 
     ret = (XRecordState*)Xmalloc(sizeof(XRecordState));
     if (!ret) {
-	/* XXX - eat data */
+	_XEatDataWords (dpy, rep.length);
 	UnlockDisplay(dpy);
 	SyncHandle();
 	return 0;
@@ -446,11 +461,7 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 	}
         if (!client_inf || !client_inf_str)
         {
-           for(i = 0; i < count; i++)
-           {
-	        _XEatData (dpy, sizeof(xRecordClientInfo));
-                _XEatData (dpy, SIZEOF(xRecordRange)); /* XXX - don't know how many */
-           }
+	   _XEatDataWords (dpy, rep.length);
 	   UnlockDisplay(dpy);
 	   XRecordFreeState(ret);
 	   SyncHandle();

commit e7e04b7be3f018ad636aba3a36bfc1cd80b9906d
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Apr 13 11:27:26 2013 -0700

    integer overflow in XRecordGetContext() [CVE-2013-2063]
    
    The nclients and nranges members of the reply are both CARD32 and need
    to be bounds checked before multiplying by the size of the structs to
    avoid integer overflow leading to underallocation and writing data from
    the network past the end of the allocated buffer.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/src/XRecord.c b/src/XRecord.c
index ba628b6..5bbd5ac 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -420,11 +420,9 @@ XRecordGetContext(Display *dpy, XRecordContext context,
     XExtDisplayInfo 	*info = find_display (dpy);
     register 		xRecordGetContextReq   	*req;
     xRecordGetContextReply 	rep;
-    int			count, i, rn;
+    unsigned int	count, i, rn;
     xRecordRange   	xrange;
-    XRecordRange	*ranges = NULL;
     xRecordClientInfo   xclient_inf;
-    XRecordClientInfo	**client_inf, *client_inf_str = NULL;
     XRecordState	*ret;
 
     XRecordCheckExtension (dpy, info, 0);
@@ -454,13 +452,18 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 
     if (count)
     {
-     	client_inf = (XRecordClientInfo **) Xcalloc(count, sizeof(XRecordClientInfo*));
-	ret->client_info = client_inf;
-	if (client_inf != NULL) {
-	    client_inf_str = (XRecordClientInfo *) Xmalloc(count*sizeof(XRecordClientInfo));
+	XRecordClientInfo	**client_inf = NULL;
+	XRecordClientInfo	*client_inf_str = NULL;
+
+	if (count < (INT_MAX / sizeof(XRecordClientInfo))) {
+	    client_inf = Xcalloc(count, sizeof(XRecordClientInfo *));
+	    if (client_inf != NULL)
+		client_inf_str = Xmalloc(count * sizeof(XRecordClientInfo));
 	}
+	ret->client_info = client_inf;
         if (!client_inf || !client_inf_str)
         {
+	   free(client_inf);
 	   _XEatDataWords (dpy, rep.length);
 	   UnlockDisplay(dpy);
 	   XRecordFreeState(ret);
@@ -476,11 +479,18 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 
 	    if (xclient_inf.nRanges)
 	    {
-		client_inf_str[i].ranges = (XRecordRange**) Xcalloc(xclient_inf.nRanges, sizeof(XRecordRange*));
-		if (client_inf_str[i].ranges != NULL) {
-		    ranges = (XRecordRange*)
-			Xmalloc(xclient_inf.nRanges * sizeof(XRecordRange));
+		XRecordRange	*ranges = NULL;
+
+		if (xclient_inf.nRanges < (INT_MAX / sizeof(XRecordRange))) {
+		    client_inf_str[i].ranges =
+			Xcalloc(xclient_inf.nRanges, sizeof(XRecordRange *));
+		    if (client_inf_str[i].ranges != NULL)
+			ranges =
+			    Xmalloc(xclient_inf.nRanges * sizeof(XRecordRange));
 		}
+		else
+		    client_inf_str[i].ranges = NULL;
+
 		if (!client_inf_str[i].ranges || !ranges) {
 		    /* XXX eat data */
 		    UnlockDisplay(dpy);

commit 46ed6283034b5b7d14584009453f5d974cfacf1e
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Apr 13 11:05:27 2013 -0700

    Use _XEatDataWords to eat data in error cases
    
    Avoids having to do calculcations based on response contents
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/configure.ac b/configure.ac
index 7ef0153..d83d4d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,12 @@ XORG_CHECK_SGML_DOCTOOLS(1.8)
 # Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(XTST, x11 [xext >= 1.0.99.4] xi [recordproto >= 1.13.99.1] [xextproto >= 7.0.99.3] inputproto)
 
+# Check for _XEatDataWords function that may be patched into older Xlib release
+SAVE_LIBS="$LIBS"
+LIBS="$XTST_LIBS"
+AC_CHECK_FUNCS([_XEatDataWords])
+LIBS="$SAVE_LIBS"
+
 # Determine if the source for man pages is available
 # It may already be present (tarball) or can be generated using xmlto
 AM_CONDITIONAL([INSTALL_MANPAGES],
diff --git a/src/XRecord.c b/src/XRecord.c
index b65451c..ba628b6 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -49,6 +49,9 @@ from The Open Group.
  * By Stephen Gildea, X Consortium, and Martha Zimet, NCD.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <stdio.h>
 #include <assert.h>
 #include <X11/Xlibint.h>
@@ -56,6 +59,18 @@ from The Open Group.
 #include <X11/extensions/extutil.h>
 #include <X11/extensions/recordproto.h>
 #include <X11/extensions/record.h>
+#include <limits.h>
+
+#ifndef HAVE__XEATDATAWORDS
+static inline void _XEatDataWords(Display *dpy, unsigned long n)
+{
+# ifndef LONG64
+    if (n >= (ULONG_MAX >> 2))
+        _XIOError(dpy);
+# endif
+    _XEatData (dpy, n << 2);
+}
+#endif
 
 static XExtensionInfo _xrecord_info_data;
 static XExtensionInfo *xrecord_info = &_xrecord_info_data;
@@ -427,7 +442,7 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 
     ret = (XRecordState*)Xmalloc(sizeof(XRecordState));
     if (!ret) {
-	/* XXX - eat data */
+	_XEatDataWords (dpy, rep.length);
 	UnlockDisplay(dpy);
 	SyncHandle();
 	return 0;
@@ -446,11 +461,7 @@ XRecordGetContext(Display *dpy, XRecordContext context,
 	}
         if (!client_inf || !client_inf_str)
         {
-           for(i = 0; i < count; i++)
-           {
-	        _XEatData (dpy, sizeof(xRecordClientInfo));
-                _XEatData (dpy, SIZEOF(xRecordRange)); /* XXX - don't know how many */
-           }
+	   _XEatDataWords (dpy, rep.length);
 	   UnlockDisplay(dpy);
 	   XRecordFreeState(ret);
 	   SyncHandle();

commit 2aafac9474a0a0a0c39797862f823255918cf368
Author: Colin Walters <walters@verbum.org>
Date:   Wed Jan 4 17:37:06 2012 -0500

    autogen.sh: Implement GNOME Build API
    
    http://people.gnome.org/~walters/docs/build-api.txt
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/autogen.sh b/autogen.sh
index 904cd67..fc34bd5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,4 +9,6 @@ cd $srcdir
 autoreconf -v --install || exit 1
 cd $ORIGDIR || exit $?
 
-$srcdir/configure --enable-maintainer-mode "$@"
+if test -z "$NOCONFIGURE"; then
+    $srcdir/configure "$@"
+fi

commit 34cfa2d2b76640f672170dfbd8b5dd4a06d95b4d
Author: Adam Jackson <ajax@redhat.com>
Date:   Tue Jan 15 14:28:48 2013 -0500

    configure: Remove AM_MAINTAINER_MODE
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/configure.ac b/configure.ac
index 1f2927f..7ef0153 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,6 @@ AC_CONFIG_HEADERS([config.h])
 
 # Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
 
 # Initialize libtool
 AC_PROG_LIBTOOL

commit 6394218aae6599b28ced3d30074e154ba4218d07
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Mon Apr 23 22:02:20 2012 -0700

    Add xextproto & xi to Requires.private
    
    Only headers are needed, not libraries to link with.   Required for
    includes of xtestconst.h (xextproto) and XInput.h (xi) in XTest.h
    public header.
    
    Fixes https://bugs.freedesktop.org/attachment.cgi?id=59835
    (originally reported as https://bugzilla.novell.com/show_bug.cgi?id=748808 )
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/xtst.pc.in b/xtst.pc.in
index 8702044..5426416 100644
--- a/xtst.pc.in
+++ b/xtst.pc.in
@@ -7,6 +7,6 @@ Name: Xtst
 Description: The Xtst Library
 Version: @PACKAGE_VERSION@
 Requires: recordproto
-Requires.private: x11 xext
+Requires.private: x11 xext xextproto xi
 Cflags: -I${includedir}
 Libs: -L${libdir} -lXtst

commit 023d494822fea9c3840e75964451fd9d5213ae06
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Mon Apr 23 22:01:16 2012 -0700

    Move -I flags from AM_CFLAGS to AM_CPPFLAGS
    
    Ensures local copy of headers takes precedence over any -I flags the
    builder may have passed in CPPFLAGS.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/Makefile.am b/src/Makefile.am
index 1091ece..67bf36e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,9 +6,11 @@ libXtst_la_SOURCES = \
 
 libXtst_la_LIBADD = @XTST_LIBS@
 
-AM_CFLAGS = \
+AM_CPPFLAGS = \
 	-I$(top_srcdir)/include \
-	-I$(top_srcdir)/include/X11/extensions \
+	-I$(top_srcdir)/include/X11/extensions
+
+AM_CFLAGS = \
 	$(XTST_CFLAGS) \
 	$(CWARNFLAGS)
 

commit 30506c32f69ea476f3b068ec3bf9b1c2a24991b8
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Apr 24 21:04:06 2012 +0200

    COPYING: add copyright notices and licenses from the manpages and specs
    
    Reported-by: Ansgar Burchardt
    Signed-off-by: Julien Cristau <jcristau@debian.org>

diff --git a/COPYING b/COPYING
index 3011710..010b270 100644
--- a/COPYING
+++ b/COPYING
@@ -64,3 +64,53 @@ 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.
+
+***************************************************************************
+
+Copyright © 1992 by UniSoft Group Ltd.
+
+Permission to use, copy, modify, and distribute this documentation for
+any purpose and without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+UniSoft makes no representations about the suitability for any purpose of
+the information in this document.  This documentation is provided "as is"
+without express or implied warranty.
+
+***************************************************************************
+
+Copyright © 1992, 1994, 1995 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+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 X CONSORTIUM 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 X Consortium 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
+X Consortium.
+
+***************************************************************************
+
+Copyright 1994 Network Computing Devices, Inc.
+
+Permission to use, copy, modify, distribute, and sell this
+documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice and this permission
+notice appear in all copies.  Network Computing Devices, Inc.
+makes no representations about the suitability for any purpose
+of the information in this document.  This documentation is
+provided "as is" without express or implied warranty.


Reply to: