Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Oracle no longer includes this term in our copyright & license notices.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Fixes: #4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Originally from OpenBSD, based on libx11@bcf7b5aa
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
These also haven't been needed since C89
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Found by using:
codespell --builtin clear,rare,usage,informal,code,names
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
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>
|
|
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>
|
|
_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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|