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

libxext: Changes to 'upstream-unstable'



 configure.ac                      |   10 +--------
 include/X11/extensions/extutil.h  |    2 -
 include/X11/extensions/multibuf.h |    6 -----
 src/Makefile.am                   |    1 
 src/XEVI.c                        |    7 +++---
 src/XMultibuf.c                   |    1 
 src/XSecurity.c                   |    1 
 src/XShape.c                      |    1 
 src/XSync.c                       |    3 --
 src/Xcup.c                        |    1 
 src/Xdbe.c                        |    7 ------
 src/Xge.c                         |   35 ++++++++++++++++-----------------
 src/eat.h                         |   40 --------------------------------------
 src/globals.c                     |    6 -----
 14 files changed, 25 insertions(+), 96 deletions(-)

New commits:
commit efdcbb7634501e1117d422636a0a75d7ea84b16b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Jul 24 01:30:38 2014 +1000

    libXext 1.3.3
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index 491aac0..8efdd1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libXext], [1.3.2],
+AC_INIT([libXext], [1.3.3],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXext])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])

commit 11aad96bd689d54156064d2e81213dc827a689d1
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Mar 6 14:56:17 2014 -0800

    Xge: remove warning messages about missing Xge extension event translations
    
    When mixing Xlib and xcb, it's quite possible for some events to be
    received for xcb-only extensions, which will subsequently not be
    translatable by the Xge WireToEvent/EventToWire hooks
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>

diff --git a/src/Xge.c b/src/Xge.c
index 5c4d72d..2811ae8 100644
--- a/src/Xge.c
+++ b/src/Xge.c
@@ -265,9 +265,6 @@ _xgeWireToEvent(Display* dpy, XEvent* re, xEvent *event)
         it = it->next;
     }
 
-    fprintf(stderr,
-        "_xgeWireToEvent: Unknown extension %d, this should never happen.\n",
-            extension);
     return False;
 }
 
@@ -295,10 +292,6 @@ _xgeEventToWire(Display* dpy, XEvent* re, xEvent* event)
         it = it->next;
     }
 
-    fprintf(stderr,
-        "_xgeEventToWire: Unknown extension %d, this should never happen.\n",
-        extension);
-
     return Success;
 }
 

commit dde40e03c10808b964dc1d6a7eb48156dd5ce4a2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Mar 8 20:09:46 2014 -0800

    XeviGetVisualInfo: Free & clear *evi_return, not evi_return pointer
    
    evi_return is passed in as a pointer to a location into which
    XeviGetVisualInfo is expected to write a pointer to the memory
    it allocated for the returned structures.  If we're failing and
    bailing out, we need to dispose of the pointer we set, not the
    one passed into us (which the caller may have put on the stack
    or allocated as part of a larger structure).
    
    Flagged by cppcheck 1.64:
    [lib/libXext/src/XEVI.c:182] -> [lib/libXext/src/XEVI.c:186]:
     (warning) Possible null pointer dereference: evi_return - otherwise it
               is redundant to check it against null.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/src/XEVI.c b/src/XEVI.c
index 6d77fdf..c9b172c 100644
--- a/src/XEVI.c
+++ b/src/XEVI.c
@@ -183,8 +183,10 @@ Status XeviGetVisualInfo(
 	_XEatDataWords(dpy, rep.length);
 	UnlockDisplay(dpy);
 	SyncHandle();
-	if (evi_return)
-	   Xfree(evi_return);
+	if (*evi_return) {
+	   Xfree(*evi_return);
+	   *evi_return = NULL;
+	}
 	if (temp_xInfo)
 	   Xfree(temp_xInfo);
 	if (temp_conflict)

commit d5447c0156f556114dbf97d6064c0c7b0fcd5f70
Author: Nathan Kidd <nkidd@opentext.com>
Date:   Fri Jan 17 13:40:07 2014 +1000

    Stricter event error checking
    
    A malicious X server claiming to not support GE but sending a GE would
    SEGV the client  (always a NULL derefrence).  Possible since d1c93500.
    
    (Also guard the EventToWire case so it's harder to shoot yourself in the
    foot.)
    
    Signed-off-by: Nathan Kidd <nkidd@opentext.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/Xge.c b/src/Xge.c
index 1f37e59..5c4d72d 100644
--- a/src/Xge.c
+++ b/src/Xge.c
@@ -108,15 +108,21 @@ static XExtDisplayInfo *_xgeFindDisplay(Display *dpy)
                                   &xge_extension_hooks,
                                   0 /* no events, see below */,
                                   NULL);
-        /* We don't use an extension opcode, so we have to set the handlers
-         * directly. If GenericEvent would be > 64, the job would be done by
-         * XExtAddDisplay  */
-        XESetWireToEvent (dpy,
-                          GenericEvent,
-                          xge_extension_hooks.wire_to_event);
-        XESetEventToWire (dpy,
-                          GenericEvent,
-                          xge_extension_hooks.event_to_wire);
+        /* dpyinfo->codes is only null if the server claims not to suppport
+           XGE. Don't set up the hooks then, so that an XGE event from the
+           server doesn't crash our client */
+        if (dpyinfo && dpyinfo->codes)
+        {
+            /* We don't use an extension opcode, so we have to set the handlers
+             * directly. If GenericEvent would be > 64, the job would be done by
+             * XExtAddDisplay  */
+            XESetWireToEvent (dpy,
+                              GenericEvent,
+                              xge_extension_hooks.wire_to_event);
+            XESetEventToWire (dpy,
+                              GenericEvent,
+                              xge_extension_hooks.event_to_wire);
+        }
     }
     return dpyinfo;
 }
@@ -238,7 +244,7 @@ _xgeWireToEvent(Display* dpy, XEvent* re, xEvent *event)
     int extension;
     XGEExtList it;
     XExtDisplayInfo* info = _xgeFindDisplay(dpy);
-    if (!info)
+    if (!info || !info->data)
         return False;
     /*
        _xgeCheckExtInit() calls LockDisplay, leading to a SIGABRT.
@@ -274,7 +280,7 @@ _xgeEventToWire(Display* dpy, XEvent* re, xEvent* event)
     int extension;
     XGEExtList it;
     XExtDisplayInfo* info = _xgeFindDisplay(dpy);
-    if (!info)
+    if (!info || !info->data)
         return 1; /* error! */
 
     extension = ((XGenericEvent*)re)->extension;

commit bb24f2970f2e425f4df90c9b73d078ad15a73fbb
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Nov 7 16:31:16 2013 -0800

    Remove fallback for _XEatDataWords, require libX11 1.6 for it
    
    _XEatDataWords was orignally introduced with the May 2013 security
    patches, and in order to ease the process of delivering those,
    fallback versions of _XEatDataWords were included in the X extension
    library patches so they could be applied to older versions that didn't
    have libX11 1.6 yet.   Now that we're past that hurdle, we can drop
    the fallbacks and just require libX11 1.6 for building new versions
    of the extension libraries.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/configure.ac b/configure.ac
index 9a1e0c2..491aac0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,13 +36,7 @@ fi
 AC_SUBST(XEXT_SOREV)
 
 # Obtain compiler/linker options for depedencies
-PKG_CHECK_MODULES(XEXT, [xproto >= 7.0.13] [x11 >= 1.1.99.1] [xextproto >= 7.1.99])
-
-# Check for _XEatDataWords function that may be patched into older Xlib releases
-SAVE_LIBS="$LIBS"
-LIBS="$XEXT_LIBS"
-AC_CHECK_FUNCS([_XEatDataWords])
-LIBS="$SAVE_LIBS"
+PKG_CHECK_MODULES(XEXT, [xproto >= 7.0.13] [x11 >= 1.6] [xextproto >= 7.1.99])
 
 # Allow checking code with lint, sparse, etc.
 XORG_WITH_LINT
diff --git a/src/Makefile.am b/src/Makefile.am
index b828547..e236c33 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,7 +12,6 @@ libXext_la_LDFLAGS = -version-number $(XEXT_SOREV) -no-undefined
 libXext_la_LIBADD = $(XEXT_LIBS)
 
 libXext_la_SOURCES = \
-	eat.h \
 	DPMS.c \
 	MITMisc.c \
 	XAppgroup.c \
diff --git a/src/XEVI.c b/src/XEVI.c
index 5a95583..6d77fdf 100644
--- a/src/XEVI.c
+++ b/src/XEVI.c
@@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/extensions/extutil.h>
 #include <X11/Xutil.h>
 #include <limits.h>
-#include "eat.h"
 
 static XExtensionInfo *xevi_info;/* needs to move to globals.c */
 static const char *xevi_extension_name = EVINAME;
diff --git a/src/XMultibuf.c b/src/XMultibuf.c
index 43d56d3..75854aa 100644
--- a/src/XMultibuf.c
+++ b/src/XMultibuf.c
@@ -34,7 +34,6 @@ in this Software without prior written authorization from The Open Group.
 #include <X11/extensions/extutil.h>
 #include <X11/extensions/multibufproto.h>
 #include <X11/extensions/multibuf.h>
-#include "eat.h"
 
 static XExtensionInfo _multibuf_info_data;
 static XExtensionInfo *multibuf_info = &_multibuf_info_data;
diff --git a/src/XSecurity.c b/src/XSecurity.c
index ab17755..73305a3 100644
--- a/src/XSecurity.c
+++ b/src/XSecurity.c
@@ -33,7 +33,6 @@ in this Software without prior written authorization from The Open Group.
 #include <X11/extensions/extutil.h>
 #include <X11/extensions/securproto.h>
 #include <X11/extensions/security.h>
-#include "eat.h"
 
 static XExtensionInfo _Security_info_data;
 static XExtensionInfo *Security_info = &_Security_info_data;
diff --git a/src/XShape.c b/src/XShape.c
index d025020..15d754f 100644
--- a/src/XShape.c
+++ b/src/XShape.c
@@ -36,7 +36,6 @@ in this Software without prior written authorization from The Open Group.
 #include <X11/extensions/shape.h>
 #include <X11/extensions/shapeproto.h>
 #include <limits.h>
-#include "eat.h"
 
 static XExtensionInfo _shape_info_data;
 static XExtensionInfo *shape_info = &_shape_info_data;
diff --git a/src/XSync.c b/src/XSync.c
index 6e2af79..3077db2 100644
--- a/src/XSync.c
+++ b/src/XSync.c
@@ -60,7 +60,6 @@ PERFORMANCE OF THIS SOFTWARE.
 #include <X11/extensions/sync.h>
 #include <X11/extensions/syncproto.h>
 #include <limits.h>
-#include "eat.h"
 
 static XExtensionInfo _sync_info_data;
 static XExtensionInfo *sync_info = &_sync_info_data;
diff --git a/src/Xcup.c b/src/Xcup.c
index cdc64c2..fd6850e 100644
--- a/src/Xcup.c
+++ b/src/Xcup.c
@@ -37,7 +37,6 @@ in this Software without prior written authorization from The Open Group.
 #include <X11/extensions/Xext.h>
 #include <X11/extensions/extutil.h>
 #include <limits.h>
-#include "eat.h"
 
 static XExtensionInfo _xcup_info_data;
 static XExtensionInfo *xcup_info = &_xcup_info_data;
diff --git a/src/Xdbe.c b/src/Xdbe.c
index 7dd6c5a..13ec347 100644
--- a/src/Xdbe.c
+++ b/src/Xdbe.c
@@ -40,7 +40,6 @@
 #include <X11/extensions/Xdbe.h>
 #include <X11/extensions/dbeproto.h>
 #include <limits.h>
-#include "eat.h"
 
 static XExtensionInfo _dbe_info_data;
 static XExtensionInfo *dbe_info = &_dbe_info_data;
diff --git a/src/eat.h b/src/eat.h
deleted file mode 100644
index 239532b..0000000
--- a/src/eat.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- *
- * 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 (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifndef HAVE__XEATDATAWORDS
-#include <X11/Xmd.h>  /* for LONG64 on 64-bit platforms */
-#include <limits.h>
-
-static inline void _XEatDataWords(Display *dpy, unsigned long n)
-{
-# ifndef LONG64
-    if (n >= (ULONG_MAX >> 2))
-        _XIOError(dpy);
-# endif
-    _XEatData (dpy, n << 2);
-}
-#endif

commit 7378d4bdbd33ed49ed6cfa5c4f73d7527982aab4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Mon Jun 24 22:55:18 2013 -0700

    Require ANSI C89 pre-processor, drop pre-C89 token pasting support
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/include/X11/extensions/multibuf.h b/include/X11/extensions/multibuf.h
index 12fda35..27165f0 100644
--- a/include/X11/extensions/multibuf.h
+++ b/include/X11/extensions/multibuf.h
@@ -30,15 +30,9 @@ in this Software without prior written authorization from The Open Group.
 
 #include <X11/extensions/multibufconst.h>
 
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define MbufGetReq(name,req,info) GetReq (name, req); \
 	req->reqType = info->codes->major_opcode; \
 	req->mbufReqType = X_##name;
-#else
-#define MbufGetReq(name,req,info) GetReq (name, req); \
-	req->reqType = info->codes->major_opcode; \
-	req->mbufReqType = X_/**/name;
-#endif
 
 /*
  * Extra definitions that will only be needed in the client
diff --git a/src/Xdbe.c b/src/Xdbe.c
index 016886c..7dd6c5a 100644
--- a/src/Xdbe.c
+++ b/src/Xdbe.c
@@ -51,15 +51,9 @@ static const char *dbe_extension_name = DBE_PROTOCOL_NAME;
 #define DbeSimpleCheckExtension(dpy,i) \
   XextSimpleCheckExtension (dpy, i, dbe_extension_name)
 
-#if !defined(UNIXCPP)
 #define DbeGetReq(name,req,info) GetReq (name, req); \
         req->reqType = info->codes->major_opcode; \
         req->dbeReqType = X_##name;
-#else
-#define DbeGetReq(name,req,info) GetReq (name, req); \
-        req->reqType = info->codes->major_opcode; \
-        req->dbeReqType = X_/**/name;
-#endif
 
 
 /*****************************************************************************
diff --git a/src/globals.c b/src/globals.c
index 8b5923d..d5e7ad0 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -51,15 +51,9 @@ from The Open Group.
 /*
  * If we need to define extra variables for each global
  */
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define ZEROINIT(t,var,val) SetZero(t,var,val); \
   SetZero (long, _libX_##var##Flag, 0); \
   SetZero (void *, _libX_##var##Ptr, NULL)
-#else /* else pcc concatenation */
-#define ZEROINIT(t,var,val) SetZero(t,var,val); \
-  SetZero (long, _libX_/**/var/**/Flag, 0); \
-  SetZero (void *, _libX_/**/var/**/Ptr, NULL)
-#endif /* concat ANSI C vs. pcc */
 
 #else /* else not ATTSHAREDLIB */
 /*

commit 230a1dc356266afb206c98e47ee72e8fca0948e2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Jun 22 10:56:53 2013 -0700

    Replace sprintf with snprintf when looking up extension error strings
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/include/X11/extensions/extutil.h b/include/X11/extensions/extutil.h
index 29404d5..b228430 100644
--- a/include/X11/extensions/extutil.h
+++ b/include/X11/extensions/extutil.h
@@ -178,7 +178,7 @@ char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \
     code -= codes->first_error;  \
     if (code >= 0 && code < nerr) { \
 	char tmp[256]; \
-	sprintf (tmp, "%s.%d", extname, code); \
+	snprintf (tmp, sizeof(tmp), "%s.%d", extname, code);            \
 	XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
 	return buf; \
     } \
diff --git a/src/XSync.c b/src/XSync.c
index ce4ab44..6e2af79 100644
--- a/src/XSync.c
+++ b/src/XSync.c
@@ -189,7 +189,7 @@ char *error_string(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
     code -= codes->first_error;
     if (code >= 0 && code < nerr) {
 	char tmp[256];
-	sprintf (tmp, "%s.%d", sync_extension_name, code);
+	snprintf (tmp, sizeof(tmp), "%s.%d", sync_extension_name, code);
 	XGetErrorDatabaseText (dpy, "XProtoError", tmp, sync_error_list[code], buf, n);
 	return buf;
     }


Reply to: