summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-19unifdef NULL_NOT_ZEROHEADmasterAlan Coopersmith1-16/+1
I can't find any evidence this was ever defined, should only have been needed for odd-ball pre-C89 compilers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-19unifdef ATTSHAREDLIBAlan Coopersmith1-14/+0
Was only defined for SGI Irix platforms in the imake configs, has never been defined since the conversion to autoconf Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-04libXext 1.3.6libXext-1.3.6Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-11-07XEVI: fix -Walloc-sizeSam James1-1/+1
GCC 14 introduces a new -Walloc-size included in -Wextra which gives (when forced to be an error): ``` XEVI.c:174:21: error: allocation of insufficient size '1' for type 'ExtendedVisualInfo' with size '48' [-Werror=alloc-size] 174 | *evi_return = Xcalloc(sz_info + sz_conflict, 1); | ^ ``` The calloc prototype is: ``` void *calloc(size_t nmemb, size_t size); ``` (Xcalloc is esenetially the same.) So, just swap the number of members and size arguments to match the prototype, as we're initialising 1 element of size `sz_info + sz_conflict`. GCC then sees we're not doing anything wrong. Signed-off-by: Sam James <sam@gentoo.org>
2023-10-08_xgeDpyClose: handle NULL return from _xgeFindDisplayAlan Coopersmith1-1/+1
Resolves gcc warning: Xge.c: In function ‘_xgeDpyClose’: Xge.c:211:13: warning: dereference of NULL ‘info’ [CWE-476] [-Wanalyzer-null-dereference] 211 | if (info->data != NULL) { | ~~~~^~~~~~ Fixes: 850263a ("Add GenericEvent extension (XGE).") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08Check for malloc failure in _xgeGetExtensionVersionAlan Coopersmith1-2/+4
Handles gcc warning: Xge.c: In function ‘_xgeGetExtensionVersion’: Xge.c:196:25: warning: dereference of possibly-NULL ‘vers’ [CWE-690] [-Wanalyzer-possible-null-dereference] Fixes: 850263a ("Add GenericEvent extension (XGE).") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08_xgeGetExtensionVersion should not free info on failureAlan Coopersmith1-1/+0
Flagged by gcc: Xge.c: In function ‘_xgeCheckExtInit’: Xge.c:154:20: warning: use after ‘free’ of ‘info’ [CWE-416] [-Wanalyzer-use-after-free] _xgeCheckExtInit passes the info pointer to _xgeGetExtensionVersion and continues to use it after the call returns. Fixes: 850263a ("Add GenericEvent extension (XGE).") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-04configure: Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOLAlan Coopersmith1-2/+2
AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008, so it's time to rely on it. Clears autoconf warnings: configure.ac:19: warning: The macro `AC_PROG_LIBTOOL' is obsolete. configure.ac:19: You should run autoupdate. m4/libtool.m4:100: AC_PROG_LIBTOOL is expanded from... configure.ac:19: the top level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-16configure: raise minimum autoconf requirement to 2.70Alan Coopersmith2-5/+6
Needed for builds on NetBSD to work correctly, since it depends on AC_USE_SYSTEM_EXTENSIONS defining _OPENBSD_SOURCE to expose the prototype for reallocarray() in the system headers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-20Wrap Xext*CheckExtension() in do { ... } while(0)Alan Coopersmith1-4/+6
Makes macro expansion safer and eliminates -Wextra-semi-stmt warnings from clang every time it is called due to semicolon after bracket. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-28libXext 1.3.5libXext-1.3.5Alan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-17COPYING: Add info for Xge.* and reallocarray.* filesAlan Coopersmith1-1/+16
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-17Remove "All rights reserved" from Oracle copyright notices.Alan Coopersmith15-15/+14
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17configure: Use AC_USE_SYSTEM_EXTENSIONS to set GNU_SOURCE & other definesAlan Coopersmith1-0/+5
Fixes: #4 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-11Convert calls to Xmalloc arrays to use Xmallocarray insteadAlan Coopersmith3-4/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-11Import reallocarray() from libX11Alan Coopersmith4-2/+91
Originally from OpenBSD, based on libx11@bcf7b5aa Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10Use calloc instead of malloc if we may not initialize all the bytesAlan Coopersmith5-6/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10Remove unnecessary (char *) casts from Xfree() argumentsAlan Coopersmith5-12/+12
These also haven't been needed since C89 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10Remove unnecessary casts of malloc/calloc resultsAlan Coopersmith8-15/+13
These aren't needed in C89 and later, but can hide missing prototypes that generate broken code on platforms where pointers are larger than ints. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10Add extutilP.h header for xgeExtRegister() prototypeAlan Coopersmith4-3/+50
Clears gcc warning: Xge.c:302:11: warning: no previous prototype for ‘xgeExtRegister’ [-Wmissing-prototypes] _X_HIDDEN xgeExtRegister(Display* dpy, int offset, XExtensionHooks* callbacks) ^~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10Xge.c, Xge.h: convert from ISO-8859-1 to UTF-8Alan Coopersmith2-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10gitlab CI: add a basic build testAlan Coopersmith1-0/+99
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10Fix spelling/wording issuesAlan Coopersmith15-18/+18
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-10Build xz tarballs instead of bzip2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-08-03add ACLOCAL_AMFLAGS = -I m4 to make aclocal pick ax_gcc_builtin.m4Matthieu Herrb1-0/+2
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-16libXext 1.3.4libXext-1.3.4Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-16Add description of libXext to README.mdAlan Coopersmith1-0/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-16Update configure.ac bug URL for gitlab migrationAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-19Update README for gitlab migrationAlan Coopersmith3-29/+24
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26autogen: add default patch prefixMihail Konev1-0/+3
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov1-4/+4
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer1-1/+1
Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-03-03Use __builtin_popcountl if available to replace Ones() in XSecurity.cAlan Coopersmith3-2/+182
If the compiler knows of a better algorithm for counting the number of bits set in a word for the target CPU, let it use that, instead of the classic algorithm optimized for PDP-6. Tested for the range of values used in XSecurity.c and verified results are the same from both: for (unsigned long i = 0; i <= XSecurityAllAuthorizationAttributes; i++) { printf("ones: %d\tpopcnt: %d\n", Ones(i), __builtin_popcountl(i)); } Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-03-03Fix typos in man pagesAlan Coopersmith2-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-03-03Assert that values buffer has enough room for provided valuesAlan Coopersmith1-0/+5
Catch if anyone ever defines more types again and forgets to increase the size of the value buffer to match. v2: assert on the full set of possible values, regardless of which the current caller passed in this call - more likely to be spotted during testing, less likely to not be found until called in production. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-03-03XSecurityGenerateAuthorization: Allocate enough space in values bufferRob Wu1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=94292 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Seth Arnold <seth.arnold@canonical.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-07-24libXext 1.3.3libXext-1.3.3Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-17Xge: remove warning messages about missing Xge extension event translationsKeith Packard1-7/+0
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>
2014-03-08XeviGetVisualInfo: Free & clear *evi_return, not evi_return pointerAlan Coopersmith1-2/+4
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>
2014-01-20Stricter event error checkingNathan Kidd1-11/+17
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>
2013-11-07Remove fallback for _XEatDataWords, require libX11 1.6 for itAlan Coopersmith10-55/+1
_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>
2013-06-24Require ANSI C89 pre-processor, drop pre-C89 token pasting supportAlan Coopersmith3-18/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-06-22Replace sprintf with snprintf when looking up extension error stringsAlan Coopersmith2-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-31libXext 1.3.2libXext-1.3.2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-02integer overflow in XSyncListSystemCounters() [CVE-2013-1982 6/6]Alan Coopersmith1-7/+25
If the number of counters or amount of data reported by the server is large enough that it overflows when multiplied by the size of the appropriate struct, then memory corruption can occur when more bytes are read from the X server than the size of the buffers we allocated to hold them. V2: Make sure we don't walk past the end of the reply when converting data from wire format to the structures returned to the caller. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-02integer overflow in XShapeGetRectangles() [CVE-2013-1982 5/6]Alan Coopersmith1-10/+14
If the number of rectangles reported by the server is large enough that it overflows when multiplied by the size of the appropriate struct, then memory corruption can occur when more bytes are read from the X server than the size of the buffer we allocated to hold them. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-26integer overflow in XeviGetVisualInfo() [CVE-2013-1982 4/6]Alan Coopersmith1-7/+18
If the number of visuals or conflicts reported by the server is large enough that it overflows when multiplied by the size of the appropriate struct, then memory corruption can occur when more bytes are read from the X server than the size of the buffer we allocated to hold them. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-26several integer overflows in XdbeGetVisualInfo() [CVE-2013-1982 3/6]Alan Coopersmith1-10/+17
If the number of screens or visuals reported by the server is large enough that it overflows when multiplied by the size of the appropriate struct, then memory corruption can occur when more bytes are read from the X server than the size of the buffer we allocated to hold them. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-26integer overflow in XcupStoreColors() [CVE-2013-1982 2/6]Alan Coopersmith1-14/+11
If the computed number of entries is large enough that it overflows when multiplied by the size of a xColorItem struct, or is treated as negative when compared to the size of the stack allocated buffer, then memory corruption can occur when more bytes are read from the X server than the size of the buffer we allocated to hold them. The requirement to match the number of colors specified by the caller makes this much harder to hit than the one in XcupGetReservedColormapEntries() Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-26integer overflow in XcupGetReservedColormapEntries() [CVE-2013-1982 1/6]Alan Coopersmith1-7/+12
If the computed number of entries is large enough that it overflows when multiplied by the size of a xColorItem struct, or is treated as negative when compared to the size of the stack allocated buffer, then memory corruption can occur when more bytes are read from the X server than the size of the buffer we allocated to hold them. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>