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

libxtst: Changes to 'upstream-unstable'



 COPYING         |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 autogen.sh      |    4 +++-
 configure.ac    |    9 +++++++--
 src/Makefile.am |    6 ++++--
 src/XRecord.c   |   55 ++++++++++++++++++++++++++++++++++++++-----------------
 xtst.pc.in      |    2 +-
 6 files changed, 103 insertions(+), 23 deletions(-)

New commits:
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 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: