Commit graph

1330 commits

Author SHA1 Message Date
walter harms
0355c3926d fix shadow char_size
Signed-off-by: walter harms <wharms@bfs.de>
2017-08-14 18:02:40 +02:00
walter harms
916dffadf0 remove argument check for free() adjust one inden
Signed-off-by: walter harms <wharms@bfs.de>
2017-08-14 18:02:40 +02:00
walter harms
6ec901ebca _XIOError(dpy); will never return so remore dead
Signed-off-by: walter harms <wharms@bfs.de>
2017-08-14 18:02:39 +02:00
walter harms
83107a677b fix shadow warning
Signed-off-by: walter harms <wharms@bfs.de>
2017-08-14 18:02:39 +02:00
Ryan C. Gordon
4fe66b1c51 Valgrind fix for XStoreColor and XStoreColors.
If the "pad" field isn't set, Valgrind will report it as uninitialized
memory accesses when the struct is copied into the Display's send buffer.

In practice, this is (probably) harmless, but Valgrind is correct in
believing it's a bug.

https://bugs.freedesktop.org/attachment.cgi?id=133189

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-08-06 16:25:25 -07:00
Alan Coopersmith
7d2010fec2 Improve table formatting in XkbChangeControls & XkbKeyNumGroups man pages
Includes fix for Solaris Bug 24564279: "XkbKeyNumGroups.3x11 man page
contains some malformed text" caused by extra whitespace after .TE macros

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-04-07 00:13:03 -07:00
Alan Coopersmith
b856d5d929 Clarify state parameter to XkbSetNamedDeviceIndicator
Checking a Bool to see if it's NULL does not work well in C.
Also reported in https://bugs.freedesktop.org/show_bug.cgi?id=251

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-03-24 15:19:27 -07:00
Alan Coopersmith
c6dadd4ceb Make Xkb{Get,Set}NamedIndicator spec & manpages match code
The XKB Library spec and the man pages for XkbGetNamedIndicator &
XkbSetNamedIndicator included a device_spec argument neither function
takes, and do not include the XkbGetNamedDeviceIndicator &
XkbSetNamedDeviceIndicator variants that do take it (along with two
other arguments).

This updates them to match the interfaces the code has provided for
decades.

This has been reported multiple times, so this fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=251
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=729812
Sun Bug 4528016 XkbSetNamedIndicator & XkbGetNamedIndicator man pages are wrong
  (filed: alan.coopersmith@sun.com 2001-11-15 - now aka Oracle bug 15087506)
X.Org Group Defect Id #9418

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-03-24 15:19:18 -07:00
Arthur Huillet
2d20890e7f _XDefaultError: set XlibDisplayIOError flag before calling exit
_XReply isn't reentrant, and it can lead to deadlocks when the default error
handler is called: _XDefaultError calls exit(1). It is called indirectly by
_XReply when a X protocol error comes in that isn't filtered/handled by an
extension or the application. This means that if the application (or one of its
loaded shared libraries such as the NVIDIA OpenGL driver) has registered any
_fini destructor, _fini will get called while still on the call stack of
_XReply. If the destructor interacts with the X server and calls _XReply, it
will hit a deadlock, looping on the following in _XReply:

    ConditionWait(dpy, dpy->xcb->reply_notify);

It is legal for an application to make Xlib calls during _fini, and that is
useful for an OpenGL driver to avoid resource leaks on the X server side, for
example in the dlopen/dlclose case. However, the driver can not readily tell
whether its _fini is being called because Xlib called exit, or for another
reason (dlclose), so it is hard to cleanly work around this issue in the driver.

This change makes it so _XReply effectively becomes a no-op when called after
_XDefaultError was called, as though an XIOError had happened. The dpy
connection isn't broken at that point, but any call to _XReply is going to hang.
This is a bit of a kludge, because the more correct solution would be to make
_XReply reentrant, maybe by broadcasting the reply_notify condition before
calling the default error handler. However, such a change would carry a grater
risk of introducing regressions in Xlib.

This change will drop some valid requests on the floor, but this should not
matter, as it will only do so in the case where the application is dying: X will
clean up after it once exit() is done running. There is the case of
XSetCloseDownMode(RETAIN_PERMANENT), but an application using that and wishing
to clean up resources in _fini would currently be hitting a deadlock, which is
hardly a better situation.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2017-03-07 12:39:51 -08:00
Matt Turner
42f4d7af9c libX11 1.6.5
Signed-off-by: Matt Turner <mattst88@gmail.com>
2017-02-25 21:54:22 -08:00
Adam Jackson
a0da5835e8 Revert "Compose sequences for rouble sign"
This reverts commit d9e3406130.

Reported to break 'make check':

https://lists.freedesktop.org/archives/xorg-devel/2017-February/052720.html
2017-02-14 15:33:29 -05:00
Mihail Konev
d9e3406130 Compose sequences for rouble sign
Cyrillic combinations mirror the Qwerty-Jcuken keyboard layout.
Also add Cyrillic sequences for hryvnia sign.

Submitted-by: Victor V. Kustov <coyote@bks.tv>
Reviewed-by: Victor V. Kustov <coyote@bks.tv>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-02-14 11:39:17 -05:00
Petr Písař
23d9623c66 Revert cs_CZ.UTF-8 XLC_LOCALE to en_US.UTF-8
The cs_CZ.UTF-8/XLC_LOCALE is an empty file leading to unsupported cs_CZ.UTF-8
locale and reporting this error:

Warning: locale not supported by Xlib, locale set to C

Therefore this patch reverts to the en_US.UTF-8 definition file that was used
before. This patch also deduplicates the cs_CZ.UTF-8 entry.

<https://bugs.freedesktop.org/show_bug.cgi?id=98219>

This reverts commit 33840a5465

Signed-off-by: Julien Cristau <jcristau@debian.org>
2017-01-27 23:55:41 +01:00
Mihail Konev
71b0929ebc autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 13:52:49 +10:00
Emil Velikov
2979011bc1 autogen.sh: use quoted string variables
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-26 11:59:25 +10:00
Peter Hutterer
4a0082a1b6 autogen.sh: use exec instead of waiting for configure to finish
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>
2017-01-26 11:59:25 +10:00
Julien Cristau
c74b070f27 Fix wrong Xfree in XListFonts failure path
'ch' gets moved inside the allocated buffer as we're looping through
fonts, so keep a reference to the start of the buffer so we can pass
that to Xfree in the failure case.

Fixes: commit 20a3f99eba "Plug a memory leak"

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-09 09:28:52 +10:00
Alan Coopersmith
663f47075f specs/libX11: Update Portability Considerations for the 21st century
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 08:50:52 +10:00
Alan Coopersmith
28f4b989b5 specs/libX11: Fix broken synopsis for Data/Data16/Data32
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-01 20:39:53 -08:00
Alan Coopersmith
382561951e specs/libX11: Add missing parameter types for XGetWindowProperty()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-01 20:31:54 -08:00
Alan Coopersmith
2beaecdb66 specs/libX11: Make paramdef spacing more consistent
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-01 20:20:32 -08:00
Alan Coopersmith
4c436c6c14 specs/libX11: Fix paramdef entries listing multiple parameters
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-01 20:13:29 -08:00
Alan Coopersmith
1728b1a8a4 specs/libX11: More synopsis fixes
Mostly transforming macro definitions and functions taking void arguments
from undecorated <para> tags to use <funcsynopsis> tags to get decorations.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-01 19:46:31 -08:00
Lucien Gentis
f0dc83db7e Typos in "Xlib - C Language X Interface" document - Chapter 02
This patch fixes typos and lack of tags in "Xlib - C Language X Interface" document - Chapter 02.

Signed-off-by: Lucien Gentis <lucien.gentis@waika9.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-01 17:11:02 -08:00
Emilio Pozuelo Monfort
20a3f99eba Plug a memory leak
This was introduced in 8ea762f.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Emilio Pozuelo Monfort <pochu@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-26 15:46:26 +10:00
Matthieu Herrb
8f349feac2 libX11 1.6.4
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2016-10-04 21:01:39 +02:00
Tobias Stoeckmann
8ea762f94f Validation of server responses in XGetImage()
Check if enough bytes were received for specified image type and
geometry. Otherwise GetPixel and other functions could trigger an
out of boundary read later on.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2016-09-25 21:26:50 +02:00
Tobias Stoeckmann
8c29f1607a The validation of server responses avoids out of boundary accesses.
v2: FontNames.c  return a NULL list whenever a single
length field from the server is incohent.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2016-09-25 21:22:57 +02:00
walter harms
78851f6a03 XFree will accept NULL as argument
since Xfree is a define for free():
  Xlibint.h:#define Xfree(ptr) free((ptr))

Xfree will accept NULL and do nothing.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-08-26 11:04:10 +02:00
Matthew D. Fuller
83adf3d1e3 Fixup param specification for XChangeProperty()
Signed-off-by: Matthew D. Fuller <fullermd@over-yonder.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-06 09:44:18 +10:00
Mats Blakstad
3129c757f9 New compose keys for local languages in Togo
Signed-off-by: James Cloos <cloos@jhcloos.com>
2016-03-09 12:47:05 -05:00
Daniel Albers
e1011b9e2f Add Compose sequence for U+1F4A9.
Signed-off-by: Daniel Albers <daniel@lbe.rs>
2016-03-09 09:47:05 -05:00
Alan Coopersmith
6d7bb040c9 xcms: use size_t for pointer offsets passed to strncmp
instead of converting to int and back

Fixes clang warnings of the form:
HVC.c:190:43: warning: implicit conversion changes signedness: 'int' to
      'unsigned long' [-Wsign-conversion]
          if (strncmp(spec, _XcmsTekHVC_prefix, n) != 0) {
              ~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-02-06 15:39:36 -08:00
Alan Coopersmith
a9266804ee xcms: use unsigned indexes when looping through unsigned values
Clears many gcc warnings of the form:

uvY.c: In function ‘XcmsCIEuvYToCIEXYZ’:
uvY.c:263:19: warning: comparison between signed and unsigned integer
  expressions [-Wsign-compare]
     for (i = 0; i < nColors; i++, pColor++) {
                   ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-02-06 13:40:26 -08:00
Alan Coopersmith
0ee0d383b4 xcms: use size_t for strlen/sizeof values instead of converting to int & back
Fixes gcc warnings of the form:

IdOfPr.c: In function ‘XcmsFormatOfPrefix’:
IdOfPr.c:69:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if ((len = strlen(prefix)) >= sizeof(string_buf)) {
                                ^
IdOfPr.c:83:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (len >= sizeof(string_buf)) Xfree(string_lowered);
           ^
IdOfPr.c:97:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (len >= sizeof(string_buf)) Xfree(string_lowered);
           ^
IdOfPr.c:104:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (len >= sizeof(string_buf)) Xfree(string_lowered);
             ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-02-06 13:39:38 -08:00
Dominik Muth
4de6ed3e7b Xlib.h: Fix macros imitating C functions.
The basic rule "put parantheses around macro parameters" should be
observed where possible. Otherwise code like

    ConnectionNumber(foo = bar);

fails to compile. (It obviously passes if ConnectionNumber is a C
function.) There are several other macros amended for the same reason.

This bug appeared while building http://ioccc.org/1993/cmills.c, so
historically it was not present.

Signed-off-by: Dominik Muth <muth@nxdomain.no-ip.biz>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-02-03 22:11:38 -08:00
Alan Coopersmith
3706b0f2b1 Don't need to link libX11-xcb against libX11
libX11-xcb only accesses data structures defined in X11 headers,
it doesn't call any functions or reference any global variables
in libX11 itself.  (Seems to have been left from previous XCL
implementation.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-02-03 21:58:24 -08:00
Alan Coopersmith
eddf1bbd18 Stop checking for preferred order of local transports
Removes --with-local-transport-order=... flag to configure.

Code which used this ordered list was removed in commit 15e5eaf628
which outsourced X11 connection handling & authentication to libxcb.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2016-02-03 21:58:18 -08:00
Alan Coopersmith
1a66c1e964 Stop checking XTRANS_SECURE_RPC_FLAGS since we no longer use them
Removes --enable-secure-rpc & --disable-secure-rpc flags to configure

Code that used SECURE_RPC definitions was removed in commit 15e5eaf628
which outsourced X11 connection handling & authentication to libxcb.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2016-02-03 21:57:47 -08:00
Olivier Fourdan
7eb724dc24 XKB: fix XkbGetKeyboardByName with Xming server
XkbGetKeyboardByName relies on flags to read the data from the server.

If the X server sends us the wrong flags or if a subreply is smaller
than it should be, XkbGetKeyboardByName will not read all the available
data and leave data in the buffer, which will cause the next _XReply()
to fail with:

[xcb] Extra reply data still left in queue
[xcb] This is most likely caused by a broken X extension library
[xcb] Aborting, sorry about that.
xcb_io.c:576: _XReply: Assertion `!xcb_xlib_extra_reply_data_left' failed.
Aborted

Check if there is some extra data left at the end of
XkbGetKeyboardByName() and discard that data if any is found.

Many thanks to Peter Hutterer <peter.hutterer@who-t.net> for finding the
root cause of the issue and Adam Jackson <ajax@redhat.com> for helping
with the analysis!

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-22 07:40:39 +10:00
Alan Coopersmith
43ba0a68d3 lcPubWrap: replace malloc(strlen) + strcpy with strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-05 17:24:26 -08:00
Alan Coopersmith
6fc95cb12b XlcDL.c: reduce code duplication
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-05 17:24:20 -08:00
Alan Coopersmith
f7ecc0856b XlcDL.c: replace strcpy+strcat sequences with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-05 17:24:12 -08:00
Alan Coopersmith
522989b343 XDefaultOMIF: Remove comments referring to ancient Sun bug ids
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-05 17:24:03 -08:00
Alan Coopersmith
b738a104ae XDefaultOMIF: additional code simplification
Don't need to test for a case that we already returned for, don't need
to store a count that will only ever be 1 if we didn't return, don't
need to increment pointers to allow storing more than one item when we
can only ever possibly do one.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-05 17:23:46 -08:00
Alan Coopersmith
31011cf100 XDefaultOMIF: replace strlen+Xmalloc+strcpy with strdup
Code seems to have been originally written to handle appending multiple
strings, but only ever operates on a single string.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-05 17:23:36 -08:00
Alan Coopersmith
c27c46d5e2 Use strdup instead of Xmalloc+strcpy in _XDefaultOpenIM
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-05 17:23:25 -08:00
Alan Coopersmith
4359dfabc0 Delete #if 0 hunks of code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-12-18 23:50:26 -08:00
Alan Coopersmith
a2f9dfac28 Bug 93183: _XDefaultOpenIM memory leaks in out-of-memory error paths
Rework code to store allocations directly into XIM struct instead of
temporary local variables, so we can use _XCloseIM to unwind instead
of duplicating it, and consistently jump to error handler on failure,
instead of sometimes leaking and sometimes freeing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93183
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-12-18 23:49:54 -08:00
Alan Coopersmith
07a97b3944 Bug 93184: read_EncodingInfo invalid free
Free the correct bits of memory if we run out and need to unwind

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93184
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-12-03 23:21:31 -08:00